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

Update: Don't focus paragraph on media & text block. #11911

Merged
merged 1 commit into from Nov 15, 2018

Conversation

Projects
None yet
3 participants
@jorgefilipecosta
Member

jorgefilipecosta commented Nov 15, 2018

Description

This PR makes sure that when we insert a "Media & Text" block, the media & text block gets selected instead of its child paragraph getting the selection right away.

Addresses an accessibility problem raised by @afercia:

This makes all the UI that is before the second RichText hardly discoverable for screen reader users and hardly operable for sighted keyboard users. Ideally, I'd tend to think this is one case where setting initial focus on the block outer wrapper would be the best option, also considering that in an already existing block the order of media and text could be reversed.

This PR makes use of a series of changes that were meanwhile merged that make this possible.

How has this been tested?

I added "Media & Text" block and I checked the outer block gets selected, the focus does not go the child paragraph.

Screenshots

Before:
nov-15-2018 12-08-48

After:
nov-15-2018 12-06-25

@jorgefilipecosta jorgefilipecosta added this to the 4.5 milestone Nov 15, 2018

@nosolosw nosolosw self-requested a review Nov 15, 2018

@nosolosw

Tested and it works as expected: the media&text block now behaves like the other media blocks (video, image).

@youknowriad youknowriad modified the milestones: 4.5, 4.4 Nov 15, 2018

@jorgefilipecosta jorgefilipecosta merged commit b009fd8 into master Nov 15, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jorgefilipecosta jorgefilipecosta deleted the update/dont-focus-paragraph-on-media-text-block branch Nov 15, 2018

grey-rsi pushed a commit to OnTheGoSystems/gutenberg that referenced this pull request Nov 22, 2018

Update: Don't focus paragraph on media & text block. (WordPress#11911)
## Description
This PR makes sure that when we insert a "Media & Text" block, the media & text block gets selected instead of its child paragraph getting the selection right away.

Addresses an accessibility problem raised by @afercia:
> This makes all the UI that is before the second RichText hardly discoverable for screen reader users and hardly operable for sighted keyboard users. Ideally, I'd tend to think this is one case where setting initial focus on the block outer wrapper would be the best option, also considering that in an already existing block the order of media and text could be reversed.

This PR makes use of a series of changes that were meanwhile merged that make this possible.

## How has this been tested?
I added "Media & Text" block and I checked the outer block gets selected, the focus does not go the child paragraph.

## Screenshots <!-- if applicable -->
Before:
![nov-15-2018 12-08-48](https://user-images.githubusercontent.com/11271197/48552241-dd17d100-e8cf-11e8-8496-4bac785ecff9.gif)

After:
![nov-15-2018 12-06-25](https://user-images.githubusercontent.com/11271197/48552250-e5700c00-e8cf-11e8-97a2-52a5124a0c48.gif)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment