You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Slab is a wonderful lib that I really enjoy working with.
I've created my own Input request message dialog, like a simple Text that ask for a value and a simple text Input.
But there is a small flaw in the Input object. In this case I ask to get the focus in my Input using : Slab.SetInputFocus(Id)
And this is working but here it comes : because it is a dialog I want that the value in the Input is always clear at opening. So I use the Text option. and I make sure that the var used is empty :
if (Slab.Input("ProjectName", { Text = self.newProjectName, W = 250 })) then self.newProjectName = Slab.GetInputText() end
So for sure self.newProjectName is == "" when I enter my dialog. But because I give the focus to the object Slab is not able to clear the Input (I found the line in the Input.lua file of Slab :
if Focused ~= Instance then if Options.MultiLine and #Options.Text ~= #Instance.Text then Instance.Lines = nil end Instance.Text = Options.Text == nil and Instance.Text or Options.Text end
(Around line 955) (edit : So sorry for the code block can't get it working :( )
it put me on the tracks of the focus problem.
So my solution for now is to wait for the user to press "tab" to give the focus to the input field.
Am I missing something ? Should I change the way I give the focus ?
Thanks for help and thanks for this amazing library.
The text was updated successfully, but these errors were encountered:
Hi,
Slab is a wonderful lib that I really enjoy working with.
I've created my own Input request message dialog, like a simple Text that ask for a value and a simple text Input.
But there is a small flaw in the Input object. In this case I ask to get the focus in my Input using : Slab.SetInputFocus(Id)
And this is working but here it comes : because it is a dialog I want that the value in the Input is always clear at opening. So I use the Text option. and I make sure that the var used is empty :
if (Slab.Input("ProjectName", { Text = self.newProjectName, W = 250 })) then self.newProjectName = Slab.GetInputText() end
So for sure self.newProjectName is == "" when I enter my dialog. But because I give the focus to the object Slab is not able to clear the Input (I found the line in the Input.lua file of Slab :
if Focused ~= Instance then if Options.MultiLine and #Options.Text ~= #Instance.Text then Instance.Lines = nil end Instance.Text = Options.Text == nil and Instance.Text or Options.Text end
(Around line 955) (edit : So sorry for the code block can't get it working :( )
it put me on the tracks of the focus problem.
So my solution for now is to wait for the user to press "tab" to give the focus to the input field.
Am I missing something ? Should I change the way I give the focus ?
Thanks for help and thanks for this amazing library.
The text was updated successfully, but these errors were encountered: