Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the element editor HUDs with slideouts:
Element editor slideouts offer the following benefits:
Slideouts can also be nested, and parent slideouts will automatically scoot over to the left, making it easier to stay oriented.
On mobile, slideouts will take up the full viewport:
Invoking an element editor is identical to before:
Slideouts have been implemented as their own concept, and can be used for other applications as well. Working with them is similar to modals and HUDs:
The following settings are available:
containerElement
– The type of element that should be used for the container (default isdiv
).containerAttributes
– Any attributes that should be added to the container element.autoOpen
– Whether the slideout should be opened automatically on instantiation (default istrue
).closeOnEsc
– Whether the slideout should be closed when the Esc key is pressed (default istrue
).closeOnShadeClick
– Whether the slideout should be closed when the surrounding area is clicked on (default istrue
).Finally, the PR adds two new helper JS methods:
Craft.trapFocusWithin()
– Prevents focus from leaving a given container via the Tab key.Craft.setFocusWithin()
– Focuses on the first focusable element within a given container.Resolves #3448
Resolves #3930
Resolves #4102
Resolves #6587
Resolves #4129
Resolves #4245
Resolves #6647
Resolves #6247
Resolves #5857
Resolves #6918
Resolves #7811