Save editors value on change #27717
Merged
Save editors value on change #27717
Conversation
Size Change: -20.6 kB (-2%) Total Size: 1.28 MB
|
Filename | Size | Change |
---|---|---|
build/a11y/index.js |
1.14 kB | 0 B |
build/block-directory/style-rtl.css |
1.01 kB | 0 B |
build/block-directory/style.css |
1.01 kB | 0 B |
build/block-library/blocks/archives/editor-rtl.css |
196 B | 0 B |
build/block-library/blocks/archives/editor.css |
196 B | 0 B |
build/block-library/blocks/audio/editor-rtl.css |
194 B | 0 B |
build/block-library/blocks/audio/editor.css |
194 B | 0 B |
build/block-library/blocks/audio/style-rtl.css |
225 B | 0 B |
build/block-library/blocks/audio/style.css |
225 B | 0 B |
build/block-library/blocks/block/editor-rtl.css |
283 B | 0 B |
build/block-library/blocks/block/editor.css |
283 B | 0 B |
build/block-library/blocks/button/editor-rtl.css |
576 B | 0 B |
build/block-library/blocks/button/editor.css |
577 B | 0 B |
build/block-library/blocks/button/style-rtl.css |
552 B | 0 B |
build/block-library/blocks/button/style.css |
552 B | 0 B |
build/block-library/blocks/buttons/editor-rtl.css |
345 B | 0 B |
build/block-library/blocks/buttons/editor.css |
346 B | 0 B |
build/block-library/blocks/buttons/style-rtl.css |
419 B | 0 B |
build/block-library/blocks/buttons/style.css |
419 B | 0 B |
build/block-library/blocks/calendar/style-rtl.css |
319 B | 0 B |
build/block-library/blocks/calendar/style.css |
319 B | 0 B |
build/block-library/blocks/categories/editor-rtl.css |
210 B | 0 B |
build/block-library/blocks/categories/editor.css |
209 B | 0 B |
build/block-library/blocks/categories/style-rtl.css |
208 B | 0 B |
build/block-library/blocks/categories/style.css |
208 B | 0 B |
build/block-library/blocks/code/style-rtl.css |
216 B | 0 B |
build/block-library/blocks/code/style.css |
216 B | 0 B |
build/block-library/blocks/columns/editor-rtl.css |
300 B | 0 B |
build/block-library/blocks/columns/editor.css |
299 B | 0 B |
build/block-library/blocks/columns/style-rtl.css |
529 B | 0 B |
build/block-library/blocks/columns/style.css |
528 B | 0 B |
build/block-library/blocks/embed/editor-rtl.css |
594 B | 0 B |
build/block-library/blocks/embed/editor.css |
595 B | 0 B |
build/block-library/blocks/embed/style-rtl.css |
489 B | 0 B |
build/block-library/blocks/embed/style.css |
489 B | 0 B |
build/block-library/blocks/file/editor-rtl.css |
314 B | 0 B |
build/block-library/blocks/file/editor.css |
313 B | 0 B |
build/block-library/blocks/file/style-rtl.css |
352 B | 0 B |
build/block-library/blocks/file/style.css |
352 B | 0 B |
build/block-library/blocks/freeform/editor-rtl.css |
2.55 kB | 0 B |
build/block-library/blocks/freeform/editor.css |
2.55 kB | 0 B |
build/block-library/blocks/gallery/style-rtl.css |
1.17 kB | 0 B |
build/block-library/blocks/gallery/style.css |
1.17 kB | 0 B |
build/block-library/blocks/group/editor-rtl.css |
433 B | 0 B |
build/block-library/blocks/group/editor.css |
432 B | 0 B |
build/block-library/blocks/group/style-rtl.css |
190 B | 0 B |
build/block-library/blocks/group/style.css |
190 B | 0 B |
build/block-library/blocks/heading/editor-rtl.css |
248 B | 0 B |
build/block-library/blocks/heading/editor.css |
248 B | 0 B |
build/block-library/blocks/heading/style-rtl.css |
212 B | 0 B |
build/block-library/blocks/heading/style.css |
212 B | 0 B |
build/block-library/blocks/html/editor-rtl.css |
384 B | 0 B |
build/block-library/blocks/html/editor.css |
385 B | 0 B |
build/block-library/blocks/image/editor-rtl.css |
801 B | 0 B |
build/block-library/blocks/image/editor.css |
800 B | 0 B |
build/block-library/blocks/image/style-rtl.css |
569 B | 0 B |
build/block-library/blocks/image/style.css |
570 B | 0 B |
build/block-library/blocks/latest-comments/editor-rtl.css |
277 B | 0 B |
build/block-library/blocks/latest-comments/editor.css |
275 B | 0 B |
build/block-library/blocks/latest-comments/style-rtl.css |
382 B | 0 B |
build/block-library/blocks/latest-comments/style.css |
382 B | 0 B |
build/block-library/blocks/latest-posts/editor-rtl.css |
254 B | 0 B |
build/block-library/blocks/latest-posts/editor.css |
254 B | 0 B |
build/block-library/blocks/latest-posts/style-rtl.css |
634 B | 0 B |
build/block-library/blocks/latest-posts/style.css |
634 B | 0 B |
build/block-library/blocks/list/editor-rtl.css |
203 B | 0 B |
build/block-library/blocks/list/editor.css |
203 B | 0 B |
build/block-library/blocks/list/style-rtl.css |
201 B | 0 B |
build/block-library/blocks/list/style.css |
201 B | 0 B |
build/block-library/blocks/media-text/editor-rtl.css |
311 B | 0 B |
build/block-library/blocks/media-text/editor.css |
311 B | 0 B |
build/block-library/blocks/media-text/style-rtl.css |
642 B | 0 B |
build/block-library/blocks/media-text/style.css |
640 B | 0 B |
build/block-library/blocks/more/editor-rtl.css |
545 B | 0 B |
build/block-library/blocks/more/editor.css |
545 B | 0 B |
build/block-library/blocks/navigation-link/editor-rtl.css |
503 B | 0 B |
build/block-library/blocks/navigation-link/editor.css |
504 B | 0 B |
build/block-library/blocks/navigation-link/style-rtl.css |
805 B | 0 B |
build/block-library/blocks/navigation-link/style.css |
803 B | 0 B |
build/block-library/blocks/navigation/editor-rtl.css |
1.38 kB | 0 B |
build/block-library/blocks/navigation/editor.css |
1.38 kB | 0 B |
build/block-library/blocks/nextpage/editor-rtl.css |
507 B | 0 B |
build/block-library/blocks/nextpage/editor.css |
507 B | 0 B |
build/block-library/blocks/paragraph/editor-rtl.css |
236 B | 0 B |
build/block-library/blocks/paragraph/editor.css |
236 B | 0 B |
build/block-library/blocks/post-author/editor-rtl.css |
329 B | 0 B |
build/block-library/blocks/post-author/editor.css |
329 B | 0 B |
build/block-library/blocks/post-author/style-rtl.css |
303 B | 0 B |
build/block-library/blocks/post-author/style.css |
303 B | 0 B |
build/block-library/blocks/post-comments-form/style-rtl.css |
358 B | 0 B |
build/block-library/blocks/post-comments-form/style.css |
358 B | 0 B |
build/block-library/blocks/post-content/editor-rtl.css |
262 B | 0 B |
build/block-library/blocks/post-content/editor.css |
262 B | 0 B |
build/block-library/blocks/post-excerpt/editor-rtl.css |
206 B | 0 B |
build/block-library/blocks/post-excerpt/editor.css |
206 B | 0 B |
build/block-library/blocks/post-featured-image/editor-rtl.css |
453 B | 0 B |
build/block-library/blocks/post-featured-image/editor.css |
453 B | 0 B |
build/block-library/blocks/post-featured-image/style-rtl.css |
223 B | 0 B |
build/block-library/blocks/post-featured-image/style.css |
223 B | 0 B |
build/block-library/blocks/preformatted/style-rtl.css |
193 B | 0 B |
build/block-library/blocks/preformatted/style.css |
193 B | 0 B |
build/block-library/blocks/pullquote/editor-rtl.css |
304 B | 0 B |
build/block-library/blocks/pullquote/editor.css |
304 B | 0 B |
build/block-library/blocks/pullquote/style-rtl.css |
428 B | 0 B |
build/block-library/blocks/pullquote/style.css |
428 B | 0 B |
build/block-library/blocks/query-loop/editor-rtl.css |
217 B | 0 B |
build/block-library/blocks/query-loop/editor.css |
216 B | 0 B |
build/block-library/blocks/query-loop/style-rtl.css |
427 B | 0 B |
build/block-library/blocks/query-loop/style.css |
429 B | 0 B |
build/block-library/blocks/query/editor-rtl.css |
279 B | 0 B |
build/block-library/blocks/query/editor.css |
279 B | 0 B |
build/block-library/blocks/quote/editor-rtl.css |
195 B | 0 B |
build/block-library/blocks/quote/editor.css |
195 B | 0 B |
build/block-library/blocks/quote/style-rtl.css |
284 B | 0 B |
build/block-library/blocks/quote/style.css |
285 B | 0 B |
build/block-library/blocks/rss/editor-rtl.css |
307 B | 0 B |
build/block-library/blocks/rss/editor.css |
309 B | 0 B |
build/block-library/blocks/rss/style-rtl.css |
394 B | 0 B |
build/block-library/blocks/rss/style.css |
393 B | 0 B |
build/block-library/blocks/search/editor-rtl.css |
285 B | 0 B |
build/block-library/blocks/search/editor.css |
285 B | 0 B |
build/block-library/blocks/search/style-rtl.css |
454 B | 0 B |
build/block-library/blocks/search/style.css |
456 B | 0 B |
build/block-library/blocks/separator/editor-rtl.css |
229 B | 0 B |
build/block-library/blocks/separator/editor.css |
229 B | 0 B |
build/block-library/blocks/separator/style-rtl.css |
352 B | 0 B |
build/block-library/blocks/separator/style.css |
352 B | 0 B |
build/block-library/blocks/shortcode/editor-rtl.css |
603 B | 0 B |
build/block-library/blocks/shortcode/editor.css |
603 B | 0 B |
build/block-library/blocks/site-logo/editor-rtl.css |
321 B | 0 B |
build/block-library/blocks/site-logo/editor.css |
321 B | 0 B |
build/block-library/blocks/site-logo/style-rtl.css |
238 B | 0 B |
build/block-library/blocks/site-logo/style.css |
238 B | 0 B |
build/block-library/blocks/social-link/editor-rtl.css |
283 B | 0 B |
build/block-library/blocks/social-link/editor.css |
283 B | 0 B |
build/block-library/blocks/social-links/editor-rtl.css |
811 B | 0 B |
build/block-library/blocks/social-links/editor.css |
810 B | 0 B |
build/block-library/blocks/social-links/style-rtl.css |
1.44 kB | 0 B |
build/block-library/blocks/social-links/style.css |
1.44 kB | 0 B |
build/block-library/blocks/spacer/style-rtl.css |
184 B | 0 B |
build/block-library/blocks/spacer/style.css |
184 B | 0 B |
build/block-library/blocks/subhead/editor-rtl.css |
223 B | 0 B |
build/block-library/blocks/subhead/editor.css |
223 B | 0 B |
build/block-library/blocks/subhead/style-rtl.css |
210 B | 0 B |
build/block-library/blocks/subhead/style.css |
210 B | 0 B |
build/block-library/blocks/table/editor-rtl.css |
593 B | 0 B |
build/block-library/blocks/table/editor.css |
593 B | 0 B |
build/block-library/blocks/table/style-rtl.css |
501 B | 0 B |
build/block-library/blocks/table/style.css |
501 B | 0 B |
build/block-library/blocks/tag-cloud/editor-rtl.css |
237 B | 0 B |
build/block-library/blocks/tag-cloud/editor.css |
235 B | 0 B |
build/block-library/blocks/tag-cloud/style-rtl.css |
221 B | 0 B |
build/block-library/blocks/tag-cloud/style.css |
221 B | 0 B |
build/block-library/blocks/template-part/editor-rtl.css |
714 B | 0 B |
build/block-library/blocks/template-part/editor.css |
714 B | 0 B |
build/block-library/blocks/text-columns/editor-rtl.css |
220 B | 0 B |
build/block-library/blocks/text-columns/editor.css |
220 B | 0 B |
build/block-library/blocks/text-columns/style-rtl.css |
283 B | 0 B |
build/block-library/blocks/text-columns/style.css |
283 B | 0 B |
build/block-library/blocks/verse/editor-rtl.css |
194 B | 0 B |
build/block-library/blocks/verse/editor.css |
194 B | 0 B |
build/block-library/blocks/video/editor-rtl.css |
617 B | 0 B |
build/block-library/blocks/video/editor.css |
617 B | 0 B |
build/block-library/blocks/video/style-rtl.css |
303 B | 0 B |
build/block-library/blocks/video/style.css |
304 B | 0 B |
build/block-library/common-rtl.css |
1.01 kB | 0 B |
build/block-library/common.css |
1.01 kB | 0 B |
build/block-library/theme-rtl.css |
860 B | 0 B |
build/block-library/theme.css |
860 B | 0 B |
build/block-serialization-spec-parser/index.js |
3.06 kB | 0 B |
build/deprecated/index.js |
768 B | 0 B |
build/dom-ready/index.js |
571 B | 0 B |
build/edit-navigation/style-rtl.css |
938 B | 0 B |
build/edit-navigation/style.css |
944 B | 0 B |
build/editor/editor-styles-rtl.css |
476 B | 0 B |
build/editor/editor-styles.css |
478 B | 0 B |
build/editor/style-rtl.css |
3.89 kB | 0 B |
build/editor/style.css |
3.89 kB | 0 B |
build/element/index.js |
4.63 kB | 0 B |
build/escape-html/index.js |
735 B | 0 B |
build/format-library/style-rtl.css |
620 B | 0 B |
build/format-library/style.css |
621 B | 0 B |
build/html-entities/index.js |
623 B | 0 B |
build/is-shallow-equal/index.js |
698 B | 0 B |
build/list-reusable-blocks/style-rtl.css |
629 B | 0 B |
build/list-reusable-blocks/style.css |
628 B | 0 B |
build/notices/index.js |
1.86 kB | 0 B |
build/nux/style-rtl.css |
731 B | 0 B |
build/nux/style.css |
727 B | 0 B |
build/plugins/index.js |
2.54 kB | 0 B |
build/primitives/index.js |
1.43 kB | 0 B |
build/redux-routine/index.js |
2.84 kB | 0 B |
build/shortcode/index.js |
1.7 kB | 0 B |
build/warning/index.js |
1.14 kB | 0 B |
This looks good, thanks for fixing. The only bothersome thing I noticed in my testing is that you get lots of block validation errors in the console while you're typing out a block. But, this isn't really new—it happened before when you blur the textfield. And, I doubt many users type out a block manually. |
4 commits
Dec 14, 2020
added …t is not forgotten when a dislpay mode is changed
…nge to editor has been introduced and given throttle time has passed
… setTimeout in index
youknowriad
force-pushed the
save-editor-value-on-change
branch
from
Jan 11, 2021
608fe1f
to
eab4a74
Thanks for fixing this longstanding issue!! |
@@ -7,13 +7,14 @@ import Textarea from 'react-autosize-textarea'; | |||
/** | |||
* WordPress dependencies | |||
*/ | |||
import { useSelect } from '@wordpress/data'; | |||
import * as wp from '@wordpress/data'; |
gziolo
Apr 6, 2021
•
Member
Yes, it should be removed, useSelect
is mocked with jest.mock
call in another place. So const useSelect = wp.useSelect;
is redundant.
Yes, it should be removed, useSelect
is mocked with jest.mock
call in another place. So const useSelect = wp.useSelect;
is redundant.
It looks like this PR might be causing the issue here: #29988 |
gziolo
pushed a commit
that referenced
this pull request
Apr 6, 2021
gziolo
added a commit
that referenced
this pull request
Apr 6, 2021
gziolo
added a commit
that referenced
this pull request
Apr 6, 2021
* revert #27717 (#30524) Co-authored-by: grzim <[email protected]> * Use getAuthors for 'showCombobox' check (#30218) * Use getAuthors for 'showCombobox' check * Add inline comment * Gallery: Set 'addToGallery' prop to false when images don't have IDs. (#30122) This also sets MediaPlaceholder value to an empty object. With both props set to "falsy" values, the gallery media frame is initialized in the "Create Gallery" state. This lets users replace placeholder images from patterns. Co-authored-by: Grzegorz <[email protected]> Co-authored-by: grzim <[email protected]> Co-authored-by: George Mamadashvili <[email protected]>
ntsekouras
added a commit
that referenced
this pull request
Apr 7, 2021
* revert #27717 (#30524) Co-authored-by: grzim <[email protected]> * Use getAuthors for 'showCombobox' check (#30218) * Use getAuthors for 'showCombobox' check * Add inline comment * Gallery: Set 'addToGallery' prop to false when images don't have IDs. (#30122) This also sets MediaPlaceholder value to an empty object. With both props set to "falsy" values, the gallery media frame is initialized in the "Create Gallery" state. This lets users replace placeholder images from patterns. Co-authored-by: Grzegorz <[email protected]> Co-authored-by: grzim <[email protected]> Co-authored-by: George Mamadashvili <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
grzim commentedDec 14, 2020
•
edited
Description
Resolving the issue #9512
The problem was the lack of updates when a user makes a change in an editor but only when the editor lost focus. This was causing situations when users were losing their input when using key shortcuts to change editor mode.
The solution is to add debounced updates after every change made in the editor. The same mechanics are used to save the text as it was done in stopEditting function (which is called when the editor is losing focus).
The function is debounced in order to minimize the number of dispatches.
How has this been tested?
Unit test to cover this case added
Screenshots
Types of changes
Bugfix
Checklist: