-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Block Editor List View: use anchor elements instead of buttons (#35655)
* Switching from using Button to an anchor tags for List View tree items. * Let's not use the HTML anchor here as it's not reliable in the editor. * Updating e2e test selectors * Updating e2e test selectors * The `href` attribute triggers the browser's native HTML drag operations. When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html. We need to clear any HTML drag data to prevent `pasteHandler` from calling inside `useOnBlockDrop`. * Using the Button's component's anchor tag, given that we're passing an href. This allows us to remove the custom CSS for the native anchor element. * Adding key event handlers for space and enter. This is to persist button element behaviour, even though we're switching to an anchor element. Forcing a tabIndex of `0` so the anchor elements are tabbable. * Reverting back to Space key since we've added a keyboard event for Space. Reinstate tabIndex
- Loading branch information
Showing
7 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters