Skip to content
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

Fix: Do not remove selected block on document tab #13545

Conversation

jorgefilipecosta
Copy link
Member

Description

Fixes: #13309

Previously when we selected the document tab on the sidebar the block was unselected, with these changes the block remains selected.

How has this been tested?

I added some block, I selected a block, I toggled the sidebar to the document tab and I verified the block kept selected.

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Jan 28, 2019
@afercia
Copy link
Contributor

afercia commented Jan 28, 2019

@jorgefilipecosta thanks for looking into this!

I've tried it too, but I'm afraid it's not so simple 🙁 The problem I ran into is that with this approach, the sidebar doesn't switch any longer to Block when clicking on a block.

  • click on a block
  • the Block tab is selected
  • click on the Document tab
  • the block stays selected (this is good)
  • at this point, click on another block
  • the sidebar doesn't switch to Block any longer

The problem is that the switching mechanism expects there's no block selected.

Copy link
Contributor

@afercia afercia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See extended comment.

@afercia
Copy link
Contributor

afercia commented Feb 24, 2019

Note: on the related issue there's some consensus to try a new approach:

would it be possible to store a reference to the "last-selected" block and, when clicking again on the Block tab, restore its selected state?

@gziolo gziolo added the [Status] In Progress Tracking issues with work in progress label Mar 8, 2019
@gziolo gziolo added [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. and removed [Status] In Progress Tracking issues with work in progress labels Apr 24, 2019
@gziolo
Copy link
Member

gziolo commented Apr 24, 2019

@jorgefilipecosta do you plan to revisit this PR or should we close it and let other contributors address it based on the feedback provided by @afercia?

@jorgefilipecosta
Copy link
Member Author

I guess we can close, I will try to revisit soon with an alternative approach.

@youknowriad youknowriad deleted the fix/do-not-remove-selected-block-on-document-tab branch May 27, 2020 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keep the selected block in a selected state when switching the sidebar to Document
3 participants