-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
DataViews: Fix typing in combobox filter #60819
Conversation
Size Change: +15 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@@ -263,7 +263,7 @@ export default function PagePages() { | |||
} = useEntityRecords( 'postType', postType, queryArgs ); | |||
|
|||
const { records: authors, isResolving: isLoadingAuthors } = | |||
useEntityRecords( 'root', 'user' ); | |||
useEntityRecords( 'root', 'user', { per_page: -1 } ); |
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.
The users endpoint only returns 10 users by default, so this issue was impossible to run into.
I've tested this and could only reproduce before you select any item. After that, it worked fine. So I've pinpointed it to the following behavior:
So, I pushed a couple of changes: reverted the initial approach 054249e and made the selectedValue use the same reference when it's empty 5dc89c5. This is good, though I'm unsure about the Gravacao.do.ecra.2024-04-17.as.16.43.32.mov |
Pushed a change for the searchValue not to be cleared on selecting an item 052b893 The fact that Ariakit has this off for single-selection and on for multi-selection was the reason the typing regression on init was introduced. This is configurable, so I welcome other people's thoughts (clearing is unexpected for me, given that I may want to check several options before clearing): Gravacao.do.ecra.2024-04-17.as.17.19.11.mov |
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.
This is ready in my view, but given the fact that I've essentially changed the implementation, I'd welcome Nik's approval before merging.
Thanks @oandregal ! 🚀 Your fix is a better one and it makes sense to not reset on selection. |
Fixes the Playground example embedded in [this documentation page](https://wordpress.github.io/wordpress-playground/build-your-first-app#preview-pull-requests-from-your-repository), which didn't load. ## How is the problem addressed? 1. Resolved the errors displayed in the browser console. 2. Updated the Blueprint based on the [code of the official Previewer](https://github.com/WordPress/wordpress-playground/blob/trunk/packages/playground/website/public/gutenberg.html). 3. Replaced [the PR](WordPress/gutenberg#60819) loaded in the example. ### Why step 3? It seems that there's an unrelated problem with [the specific PR used](WordPress/gutenberg#47739) in the demo: 1. It doesn't work when loading it directly in the [Gutenberg PR Previewer](https://playground.wordpress.net/gutenberg.html). 2. Other random PRs load correctly in the example. Using 60819 can be a temporary workaround. ## Testing Instructions 1. Run `nx dev docs-site`. 2. Go to [this documentation page](https://wordpress.github.io/wordpress-playground/build-your-first-app#preview-pull-requests-from-your-repository). 4. Scroll a bit, and click the **Try it now** button.
What?
In Data Views filters when we have more than 10 available options we render a combobox. There was a regression introduced here, where you couldn't type in the combobox and filter the options.
How
Testing Instructions
author
combobox filter