-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Replaced focus with isSelected verification on hooks. #5004
Replaced focus with isSelected verification on hooks. #5004
Conversation
This fixes a bug where classes and anchor inputs are not being shown.
@jorgefilipecosta Wow! That escalated quickly :D You are very welcome! I didn't know that |
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.
Thanks for the fix. A quick e2e test for the anchor/classname feature would be good I think.
@jorgefilipecosta @youknowriad have you tried adding value and saving it? It seems not saving, not sure if it's only on my end. Would you mind checking too? Thanks! |
Hi @phpbits in my tests changes to anchor and classes get correctly saved. If testing in master the problem happens, feel free to open a new issue, and we will look further. |
@phpbits it saves for me as well. |
@jorgefilipecosta @youknowriad Sorry! Just figured it out too :) The problem is with the Classic Block. It's not saving while the others do. Do I need to open a new issue about this? You can also try it and let me know if you are having the same issue. Thanks! |
Same with Columns Block, also not saving but probably because it's still experimental. Haven't checked all blocks though, there might be more that are not saving. Thanks! |
@phpbits on the classic block, given the nature of the block, custom classes functionality in inspector should not be allowed. The block had an unsupported declaration for it, but the property name changed and the declaration was not updated in accordance. A PR that fixes this problem was submitted #5005. Thank you for reporting this! |
@jorgefilipecosta you are very welcome :) Thank you too for the fast response! Is that also the reason why the block contents are not saving for Classic Block and Column Blocks? Thanks! |
Hey folks, just curious if this works for fields within a block being selected or just an entire block being selected? Thanks! |
@zgordon What do you mean exactly? If you're asking if selecting a field in a block, selects the block, the answer is yes. |
Thanks @youknowriad :) I was actually referring to technique for checking if a specific field is selected in a block (particularly managing focus in fields in blocks with multiple fields). Was also wondering if focus could/would maintain backwards compatibility for a bit? |
@zgordon You'd have to implement as local state in this case, you might want to take a look at how we do it using And we're mainting backwards compatibility for simple usage |
@youknowriad that all makes total sense! Thank you!! #GoState |
This fixes a bug where classes and anchor inputs are not being shown.
The focus property has been removed, and now isSelected should be used. During this change, hooks were not updated causing our checks condition to fail.
Props to @phpbits for reporting this problem.
How Has This Been Tested?
Verify custom anchor input appears e.g: in the heading block.
Verify custom class input appears e.g: in the image block.