Page Parent: Change the default value of 'fieldValue' state#76354
Page Parent: Change the default value of 'fieldValue' state#76354
Conversation
|
Size Change: -5 B (0%) Total Size: 6.89 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 447c0e4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/22901555105
|
|
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. |
| export function PageAttributesParent() { | ||
| const { editPost } = useDispatch( editorStore ); | ||
| const [ fieldValue, setFieldValue ] = useState( false ); | ||
| const [ fieldValue, setFieldValue ] = useState( '' ); |
There was a problem hiding this comment.
Oh sheez thanks for catching that. LGTM
|
Thanks for testing everyone!
Probably a leftover from a very old component and pattern that got copied. Happens every once in a while. |
What?
This is a follow-up to #73836.
PR changes the default value of 'fieldValue' state from
null|falseto an empty state. Which fixes the following issue:orderby: 'relevance'is set.It looks like
onFilterValueChangeimmediately updates the state as an empty string when the input is in focus. Since we're dealing with a string, it's better to use an empty string as a default value.Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2026-03-10.at.16.00.47.mp4