Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

separate iron-overlay-behavior in multiple, lightweight behaviors #179

Open
valdrinkoshi opened this issue May 13, 2016 · 2 comments
Open

Comments

@valdrinkoshi
Copy link
Member

iron-overlay-behavior is composed by 3 parts:

opening/closing an element

This part eases the showing/hiding of an element, and shortcuts like close on ESC pressed.

focus wrapping/trapping

This part deals with focus e.g. with-backdrop should wrap the focus within the element and bring the focus back if the user clicks outside the element. This might be useful also outside overlays.

position & resize

This part centers and sets the max-width/max-height of the element when it gets opened, or when the window resizes (basically iron-fit-behavior + iron-resize-behavior). This might not be useful for all overlays, e.g. if the author wants to position the overlay on the bottom left, there's no need to have the resizable or fit behavior.

Proposal

Have 3 new behaviors:

iron-focus-wrap-behavior

It deals with focus wrapping & trapping as soon as the focus lands inside the element. It provides ways to save and restore the deepest activeElement.

iron-overlay-base-behavior

It does the open/closing, uses iron-focus-wrap-behavior ensuring the focus is correctly set/restored on open/close.

iron-overlay-behavior

Extends iron-overlay-base-behavior by adding the iron-fit-behavior and iron-resizable-behavior.

@valdrinkoshi
Copy link
Member Author

@frankiefu @blasten @cdata FYI, feedback more than welcome

@valdrinkoshi
Copy link
Member Author

@keanulee FYI

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

No branches or pull requests

1 participant