Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Tab order should automatically adjust when adding controls to FormUI #227

Closed
Konzertheld opened this issue Oct 2, 2011 · 7 comments
Closed

Comments

@Konzertheld
Copy link
Member

Maybe I oversee something but when fields are added to a form, such as another text field before the tags field on the publish post page, the control order is destroyed. Before you could switch from title to content - tags - save - publish by pressing TAB, the new controls don't insert into that order so they come at the end: save - publish - delete - menu - links - silos - new fields.

@mikelietz
Copy link
Member

Currently the tab index of a control can be manually changed, and is set/retrieved with $control->tabindex. That said, it doesn't check for duplication/adjust automatically.

@Konzertheld
Copy link
Member Author

Sorry, I was absent from coding for a while. So... this might be a feature for the future, hm? Automatically adjusting the tabindex.

@Konzertheld
Copy link
Member Author

Still happens after the FormUI rewrite. Maybe @ringmaster could take care of it when finishing the rewrite.

@ringmaster
Copy link
Member

I do not understand this issue. When I'm on the publish page, the controls tab in this order: title > content > tags > save > publish

What order should they tab in instead? What added fields cause the tab order to deviate from that expectation?

@Konzertheld
Copy link
Member Author

The existing fields keep their order, but the new ones don't integrate properly. They just get added at the very end. So, it's more like a suggestion to automatically assign them a tabindex matching their position in the form.

@Konzertheld
Copy link
Member Author

I updated the ticket to reflect what this actually means.

@Konzertheld
Copy link
Member Author

A workaround is easy:
$form->insert($form->label_for_tags, FormControlLabel::wrap(_t('Event Location'), FormControlText::create('location')->set_property('tabindex', $form->tags->properties['tabindex'])));

That sets the tabindex to the same index as the next control which will allow tabbing in the order of appearance in code. Leaves me wondering:

  • Why do we use tabindex at all? Selecting silos with TAB is annoying, too.
  • When I tab to title or tags and the control is out of screen, the page scrolls. When I tab to my new field and it is out of screen, the page does not scroll. How is that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants