Repository navigation
Annotations: Merge assigned block className with incoming prop - #21184
Merged
Merged
Conversation
|
Size Change: +18 B (0%) Total Size: 856 kB
ℹ️ View Unchanged
|
ellatrix
approved these changes
Mar 26, 2020
ellatrix
left a comment
Member
There was a problem hiding this comment.
Should we add a test? I'm fine either way.
Member
Author
|
@ellatrix From the original comment:
|
ellatrix
pushed a commit
that referenced
this pull request
Mar 27, 2020
jorgefilipecosta
pushed a commit
that referenced
this pull request
Mar 27, 2020
jorgefilipecosta
pushed a commit
that referenced
this pull request
Mar 27, 2020
This file contains hidden or 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
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #21172
Related: #19514
This pull request seeks to resolve an issue in the implementation of annotations whereby it would replace the
classNameassigned to the original component. This interfered with the changes introduced as of #19514 in that the.is-drop-targetclass name was no longer being assigned.The changes here resolve this by merging any incoming
classNamevalue to the assignedclassName.Testing Instructions:
Repeat Steps to Reproduce from #21172, verifying the drop target appears when dragging a block.
As noted in #21172 (comment), this is most easily accomplished by enabling the "Gutenberg Test Plugin, Plugins API" plugin, assuming the default development environment is used.
Future Tasks:
There should be automated testing for this behavior. However, the implementation of annotations using
withSelectis not easily tested without significant refactoring of the implementation itself (migrating to useuseSelecthook and/or extracting common function for class name assignment). Since this may or may not need to be cherry-picked for WordPress 5.4, it would be best to save refactoring for future effort.cc @herregroen