Skip to content

suppress focus outlines for console output regions - #7570

Merged
gtritchie merged 1 commit into
masterfrom
bugfix/focus-outlines-console-output
Aug 11, 2020
Merged

gtritchie merged 1 commit into
masterfrom
bugfix/focus-outlines-console-output

Conversation

@gtritchie

Copy link
Copy Markdown
Member

Intent

When selecting text from the Console output region, keyboard focus rectangles were being shown if you pressed a key (e.g. using Shift to extend the selection; these could be quite ugly and don't serve any real purpose, so this change gets rid of them.

It gets much uglier if you turn off the (relatively new) accessibility option "Always show focus outlines". Then just clicking on it was enough to trigger focus outlines.

Approach

Use CSS to suppress focus rectangles. Sometimes focus was being placed on the div that wraps the entire output region, sometimes it was being placed on the individual spans used to wrap each output "chunk" so the css needed to handle both.

QA Notes

Generate some console output, then click on it, then tap Shift key (or any key). Previously you'd see something like this:

screenshot of console showing jagged focus outline around console output

It was much worse if you had the "Always show focus outlines" option unchecked.

another screenshot of console showing jagged focus outlines

With the fix those focus outlines should no longer display whether or not the "Always show focus outlines" option is enabled.

Other Notes

This focus-rectangle suppression is itself a minor accessibility issue, but the main scenario for putting focus on the console output via keyboard is for screen reader users via the "Focus Console Output" command, in which case focus-rectangles are not necessary since the screen reader will announce that focus is in the console output.

If we ever support selection of console output via keyboard-only, then we'll have to revisit this. #6077

@gtritchie gtritchie added this to the v1.4 milestone Aug 11, 2020
@gtritchie
gtritchie requested a review from adamconroy August 11, 2020 20:37

@adamconroy adamconroy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What a funny/messy/annoying bug!

@gtritchie
gtritchie merged commit 279e916 into master Aug 11, 2020
@valerie-rstudio
valerie-rstudio deleted the bugfix/focus-outlines-console-output branch January 21, 2022 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pressing Shift while highlighting text in console history causes spurious focus rectangles to show

2 participants