Skip to content
New issue

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

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

Already on GitHub? # to your account

Input request type message dialog #54

Closed
halsten-dev opened this issue Sep 30, 2020 · 1 comment
Closed

Input request type message dialog #54

halsten-dev opened this issue Sep 30, 2020 · 1 comment

Comments

@halsten-dev
Copy link

halsten-dev commented Sep 30, 2020

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.

@coding-jackalope
Copy link
Collaborator

Hi @chicogamedev, thanks for reporting the issue. I'll take a look into this for the next upcoming patch release.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants