Update/form token field onblur#54445
Conversation
|
Size Change: +27 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 8cb9edb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6178239193
|
e291597 to
81876cd
Compare
b41360a to
85f4c5e
Compare
8cb9edb to
d408594
Compare
|
@aaronrobertshaw, @kevin940726 now that the main category PR is merged I have rebased this against trunk - it was all tested and approved here, but backed that out as this is better as single commit into trunk - so could do with a quick retest before merging into trunk when yo have time. |
aaronrobertshaw
left a comment
There was a problem hiding this comment.
Thanks for splitting this one out on its own @glendaviesnz 👍
LGTM!
✅ Has changelog
✅ Unit tests pass
✅ Component behaves as advertised in Storybook examples
✅ Test well in the post editor
|
Added a dev note in the PR description |
What?
Adds a
tokenizeOnBlurprop. This is a copy of #53976 as merging that into the feature branch was not the best approach, so reverted that and will rebase this against trunk and merge into trunk separately once the rest of the pattern category feature is merged.Why?
To allow consuming components to specify that any
incompleteTokenValueis saved when the field loses focus. The main purpose for this is to prevent users saving the new add patterns model with unsaved categories added.How?
If
tokenizeOnBluristruethenaddNewTokenis run inonBlurTesting Instructions
Create patternmenu option'click outside the box so it loses focusScreenshots or screencast
Before:
form-token-before.mp4
After:
form-token-after.mp4
✍️ Dev note
A new
tokenizeOnBlurprop has been added toFormTokenField, causing the component to tokenize its current input instead of discarding it when losing focus.This is particularly useful when
FormTokenFieldis used in places like modals, where the user may press a button causing the modal to close andFormTokenFieldto lose focus before its input could be tokenized.