Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
TextBox widget #71
Behavior (edit comment to add more):
Insert new text
Select text with mouse
When not holding Shift:
When holding Shift:
When the textbox is not captured there is no selection / cursor so the view can not be based on it. Therefore, I think it makes sense to set the view to whatever it was when the textbox was last captured, but what should happen if the text in the textbox is updated without being captured again first? Should the view reset to display whatever fits starting from the beginning of the text or slide left to the end of the new text or something else?
Currently, when the text is changed without interaction with the textbox and the textbox is captured the cursor / selection.end slides left if the text became shorter than the selection, otherwise it is unchanged.
It looks like input boxes in the browser reset and display from the start of the text when capture is lost, so unless anyone objects, I will go with this for now. This also means I don't need to keep track of what the view was before capture was lost, which is nice.
referenced this issue
Aug 16, 2016
Trying to find the best place to ask this without opening a new issue. Is it possible to set the focus to a TextBox when it is first created? I'm creating a new one in a kind of pop up and would love it for to capture keyboard input straight away so the user can start typing without having to click on it with the mouse.