Commit Graph

17 Commits

Author SHA1 Message Date
Fabian Fiorotto
b48db24392 Destroy panels after test. 2022-09-04 15:30:51 -07:00
sadick254
89597affff
Use custom elements on TestPanelContainerItemElement 2021-07-27 20:50:13 +03:00
Rafael Oleza
7f3f040628 Reformat all JS files using prettier 2019-05-31 18:33:56 +02:00
Rafael Oleza
165a297d31 Merge branch 'master' into autoFocus-element 2019-04-26 20:23:09 +02:00
Rafael Oleza
c35ec012b4 Run prettier on spec/ folder 2019-02-28 19:30:03 +01:00
Tony Brix
4ba47b59d6 add test 2019-01-15 22:18:19 -06:00
Will Binns-Smith
128f702784 Add documentation to addModalPanel api 2017-08-22 23:14:54 -07:00
Will Binns-Smith
236065d0f6 Remove more semicolons 2017-08-22 23:10:14 -07:00
Will Binns-Smith
e8913660fa Make autoFocus opt-in 2017-08-22 23:10:14 -07:00
Will Binns-Smith
0916b4c4f0 Manage focus for modal panels
This implements automatic focus management for modal panels using the
excellent focus-trap module.

Upon being shown, modals will have their first tabbable element
automatically focused, and shifting focus with the tab key (or more
correctly the core:focus-next command) will be limited to the contents
of the modal. If the modal does not have any tabbable elements, focus()
will be sent to the panel's root element (if it implements it).

I'm happy to update this to *always* calls focus on the panel's root
element, but then modal implementers would need to handle that and
focus things on their own. I'd argue the tabbable element behavior
is more accessible though :)

This has the effect of not automatically closing most of Atom's own
modals whenever the tab key is pressed, which was an odd nonstandard
behavior, IMO.

This also automates returning focus to the element that had focus before
the modal was shown, something up until now had to be implemented in
every modal in Atom.

This likely breaks a few contracts for existing Atom packages that
create modals, but I've found this doesn't conflict behaviorally with
well-behaved modals like the command palette which implement their own
focus management (which can be removed if this lands).

Released under CC0.
2017-08-22 23:09:44 -07:00
Will Binns-Smith
882a1924f0 Remove one-off eslint global pragmas in favor of envs 2017-08-20 19:55:00 -07:00
Max Brunsfeld
09554615d4 Fix usages of removed getModel method in tests 2017-04-11 09:15:52 -07:00
Max Brunsfeld
d0421a75c8 Add Panel.getElement and remove Panel view provider 2017-04-05 16:10:21 -07:00
Max Brunsfeld
d1e8e359ce Add PanelContainer.getElement, remove PanelContainer view provider 2017-04-05 16:03:33 -07:00
Matthew Dapena-Tretter
d6a354d6ba Convert panel container to JS: Cleanup 2017-03-07 14:52:32 -08:00
Matthew Dapena-Tretter
f56865b6f8 Convert panel container to JS: Lint 2017-03-07 14:30:33 -08:00
Matthew Dapena-Tretter
228b24b68b Convert panel container to JS: Decaffeinate 2017-03-07 14:20:27 -08:00