haxeui icon indicating copy to clipboard operation
haxeui copied to clipboard

[Feature] Tab between multiple TextInput

Open julsam opened this issue 10 years ago • 10 comments

Being able to press <tab> to switch between text inputs would be great. I tried implementing it myself, but couldn't find a way to do it...

julsam avatar Apr 04 '14 04:04 julsam

Thanks,

Yes, this is certainly a needed feature.

ianharrigan avatar Apr 08 '14 11:04 ianharrigan

See the above commit, I made some inline comments in Github.

I made 2 demos to see the difference:

  1. one before the commit
  2. one after the commit

Try to tab between TextInputs, it should work perfectly in the second one, even with TabViews. Then, try the Popup button with more TextInputs in it, that's where I have trouble. As you can see, if you tab between the Popup's inputs, you'll go behind the modal overlay to the underlying inputs. I'm not sure how to disable them when there is an overlay.

julsam avatar Apr 19 '14 10:04 julsam

Right, but this will only work for flash, right? I dont think it will work for cpp/neko... i think proper way to do it is to create a FocusManager

ianharrigan avatar Apr 22 '14 16:04 ianharrigan

this will only work for flash, right?

That's right. 'tabEnabled' doesn't seem to be implemented in openfl. I'll try to take some time to look into FocusManager

julsam avatar Apr 22 '14 16:04 julsam

Well, its on my list defo... So i will get round to it... ideally it wouldnt be for just textinputs either... I think should should be able to tab focus through most/all haxeui components, but it needs some thought

ianharrigan avatar Apr 22 '14 16:04 ianharrigan

As you can see, there is:

https://github.com/ianharrigan/haxeui/blob/master/src/haxe/ui/toolkit/core/FocusManager.hx

and

https://github.com/ianharrigan/haxeui/blob/master/src/haxe/ui/toolkit/core/interfaces/IFocusable.hx

But then dont do anything and are more there as a reminder really.

ianharrigan avatar Apr 22 '14 16:04 ianharrigan

Alright then, that's great ! :)

julsam avatar Apr 22 '14 16:04 julsam

Yeah, the FocusManager is definitively the proper way to do it, especially with multiple target.

julsam avatar Apr 22 '14 16:04 julsam

Tab key would be great to use to jump around all inputs. Also, a "tab order" value on widgets would be valuable, like in HTML.

naturally-intelligent avatar Jul 03 '14 18:07 naturally-intelligent

Yeah, agreed, its an important feature. It should also work for popups also... so a new FocusManager for each popup that goes back to the previous one when the popup is dismissed.

ianharrigan avatar Jul 03 '14 18:07 ianharrigan