Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #12

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Dev #12

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 6 additions & 26 deletions src/Components/TextInput.luau
Original file line number Diff line number Diff line change
Expand Up @@ -143,38 +143,18 @@ return function(Scope: Fusion.Scope<any>, Props: Props)
Padding = Scope:Computed(function(Use)
return UDim.new(0, Use(Theme.Spacing["0.5"]))
end),
PaddingLeft = Scope:Spring(
Scope:Computed(function(Use)
if Use(InvalidInputActive) then
return UDim.new(0, Use(Theme.Spacing["0.75"]))
else
return UDim.new(0, Use(Theme.Spacing["0.5"]))
end
end),
Theme.SpringSpeed["1"],
Theme.SpringDampening["1"]
),
PaddingRight = Scope:Spring(
Scope:Computed(function(Use)
if Use(InvalidInputActive) then
return UDim.new(0, Use(Theme.Spacing["0.75"]))
else
return UDim.new(0, Use(Theme.Spacing["0.5"]))
end
end),
Theme.SpringSpeed["1"],
Theme.SpringDampening["1"]
),
StrokeEnabled = true,
StrokeColor = Scope:Spring(
Scope:Computed(function(Use)
if Use(IsFocused) then
if Use(InvalidInputActive) then
return Use(Theme.Colors.Error.Main)
elseif Use(IsFocused) then
return Use(Color)
else
return Use(Theme.Colors.NeutralContent.Dark)
end
end),
Theme.SpringSpeed["1"],
Theme.SpringSpeed.Immediate,
Theme.SpringDampening["1"]
),
StrokeTransparency = Scope:Spring(
Expand Down Expand Up @@ -208,7 +188,7 @@ return function(Scope: Fusion.Scope<any>, Props: Props)
return Use(TextColor3)
end
end),
Theme.SpringSpeed["1"],
Theme.SpringSpeed.Immediate,
Theme.SpringDampening["1"]
),
TextSize = TextSize,
Expand Down Expand Up @@ -253,8 +233,8 @@ return function(Scope: Fusion.Scope<any>, Props: Props)
local NewText = Object.Text
local ProcessedText = ProcessText(NewText)

Text:set(ProcessedText)
if Object.Text ~= ProcessedText then
Text:set(ProcessedText)
Object.Text = ProcessedText
end

Expand Down
2 changes: 1 addition & 1 deletion wally.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "imavafe/onyx-ui"
description = "Quick, quality UI for Fusion"
version = "0.4.2"
version = "0.4.3"
license = "MIT"
authors = ["Avafe"]

Expand Down