-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Patterns: Disable the preview option button when editing #53913
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dca0253
Don't show the preview options button when editing patterns
t-hamano 666a8c9
Refactor with FOCUSABLE_ENTITIES
t-hamano 76dcc0c
Merge branch 'trunk' into fix/pattern-preview-options
t-hamano 572e6fd
Use disabled view icon
t-hamano f30f3b9
Merge branch 'trunk' into fix/pattern-preview-options
t-hamano 7f550cc
Use isEnabled prop
t-hamano 758e448
Also set 'disableOpenOnArrowDown'
Mamaduka 70e6e63
Fix e2e test
t-hamano a5c6ae8
Use `toBeDisabled`
t-hamano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ test.describe( 'Style Book', () => { | |
).not.toBeVisible(); | ||
await expect( | ||
page.locator( 'role=button[name="View"i]' ) | ||
).not.toBeVisible(); | ||
).toHaveAttribute( 'aria-disabled', 'true' ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should use Ref: https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-be-disabled. |
||
} ); | ||
|
||
test( 'should have tabs containing block examples', async ( { page } ) => { | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this prop to make the dropdown focusable even when it is disabled and to show the tooltip. This change will also affect the preview option button in the Post Editor. Do you think this should not be added in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's fine and a good improvement here.
I just realized that we also need to set
disableOpenOnArrowDown
based on the enabled status to avoid the opening drop via the arrow-down key. Pushed changes here 758e448.Screencast
CleanShot.2023-08-29.at.17.13.47.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for finding it, @Mamaduka!