Skip to content

Commit

Permalink
Merge pull request #12 from ImAvafe/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ImAvafe authored Sep 17, 2024
2 parents 95b7f74 + b2c58e8 commit adf91dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
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

0 comments on commit adf91dd

Please sign in to comment.