Problem/Motivation

We have a workaround for the details focus effect to make it more consistent with Chrome. However, this makes the details element focus inconsistent with some other elements on the same browser. Since this is presumably expected behavior in Firefox (on OS X) and not a bug, we should consider whether we want to have this workaround or not.

The motivation is to make the focus effect behavior consistent across websites visited with the same browsers .

There aren't any macOS system settings that make a difference.

Steps to reproduce

  1. Install Drupal, log in with an admin user and visit /admin/config/system/site-information'.
  2. Click on the Site details summary, collapse and expand it. Using 'Stable' or 'Stark' themes, you will see the (browser-default) focus effect of the <summary> element in browsers, but not in Firefox on OS X operating system. With Claro theme, you will see the focus effect.
  3. Now focus the Site details summary with keyboard. You will see the focus effect of the <summary> element with every browser.

Proposed resolution

Remove Claro's details summary workaround and rely on Firefox's default behavior when it comes to details focus effects.

Remaining tasks

  • patch
  • review
  • commit

User interface changes

Users using Firefox on OS X operating system won't see the focus effect of details summary if they are using their pointer device for collapsing or expanding the <details> element.

API changes

Nothing.

Data model changes

Nothing.

Issue fork drupal-3085794

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

wim leers’s picture

lauriii’s picture

Issue tags: +Accessibility

We could benefit from an accessibility review for sure.

huzooka’s picture

The workaround I wrote is only needed for iOS.

And the case I was working around there is not a Firefox error or bug. It is a feature!
Firefox simply follows the operating system settings (that are ignored by Google Chrome for example).

https://bugzilla.mozilla.org/show_bug.cgi?id=756028#c1

I think we can remove it without worries.

wim leers’s picture

Wow, so a "Firefox on iOS"-only work-around?!

I think we can remove it without worries.

🥳

huzooka’s picture

Sorry, I was wrong. Not iOS. OS X. (The desktop.)

fhaeberle’s picture

Issue tags: +DrupalCon Amsterdam 2019
huzooka’s picture

Project: Claro » Drupal core
Version: 8.x-2.x-dev » 8.9.x-dev
Component: Code » Claro theme
chrisdarke’s picture

Issue tags: -Novice, -DrupalCon Amsterdam 2019 +Amsterdam2019

Updating tags to change the DrupalCon Amsterdam 2019 to 'Amsterdam2019' and temporarily removing 'novice' tag to reserve this for Contribution Day

chrisdarke’s picture

Added the 'needs issue summary update' tag because there is little information about what the changes should be, missing information from the standard issue summary template.

jepster_’s picture

Status: Active » Needs review
StatusFileSize
new3.73 KB
new437.11 KB

In the attached patch the firefox workaround is being removed. The different behavior cannot be reproduced anymore via a comparison of latest Chrome (77.0.3865.120) to Firefox (70.0).

comparison

huzooka’s picture

Status: Needs review » Active

Re #11:

As I see, the patch removes all the focus styles.

We only want to remove the Firefox (and Safari) workaround which is here.

jepster_’s picture

Status: Active » Needs review
StatusFileSize
new854 bytes

Removed the mentioned code in #12.

huzooka’s picture

Status: Needs review » Needs work

Re #13:

@Peter Majmesku, you missed compiling the es6. See https://www.drupal.org/node/2815083

fcobbaert’s picture

StatusFileSize
new1.52 KB
new698 bytes

I have built the js and can confirm there is now a small difference between Firefox on OSX and other browsers. It seems the focus effect is now applied for a short moment when the summary is clicked and then the outline disappears again.

fcobbaert’s picture

Status: Needs work » Needs review
jepster_’s picture

StatusFileSize
new704.33 KB

@fcobbaert: Yep, the display in Firefox is different now. The outline disappears quickly on Firefox. In Chrome it does not. See Gif below (Chrome on the left, Firefox on the right).

Chrome

It looks like the Firefox workaround is not really a workaround and should be kept. Shall we better close this issue?

huzooka’s picture

It IS a workaround, but only for Firefox on OS X :)
(If you reach the focusable summary with keyboard, it works the way you expect it to.)

john cook’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new3.09 MB

I've had a look at the patch from comment #15. Only the workaround has been removed.

When manually testing on Firefox (Mac OS) the focus is removed when the summary elements are clicked.

I've uploaded a video of a Chrome and Firefox comparison.

Changing to RTBC.

lauriii’s picture

Status: Reviewed & tested by the community » Needs review

It seems like the focus ring is visible still on active state. It seems redundant to me but it would be nice to hear from designers and accessibility folks whether we should remove that.

huzooka’s picture

Re #20:

If you thoroughly check the desings you will notice that the focus ring belongs to the focus state, regardless of other states are present or not.

May proposal: if this is the only issue you noticed, lets open a separate issue for it and discuss it there.

This task is about the OS X Firefox workaround removal 🙂.

huzooka’s picture

As discussed with @lauriii:

We also have to remove the flickering green focus of Firefox on OSX that can be seen in #17.
But only for Firefox, and only on OSX.

The behavior of other browsers and even Firefox on other operating systems must not change.

huzooka’s picture

Status: Needs review » Needs work
huzooka’s picture

Assigned: Unassigned » huzooka
huzooka’s picture

Tested with Firefox, Chrome and Safari, but only with OS X host, so further testing needed.

huzooka’s picture

Assigned: huzooka » Unassigned
lauriii’s picture

Status: Needs work » Needs review
Issue tags: +Needs manual testing

Thank you! Moving to needs review and tagging with needs manual testing.

huzooka’s picture

I tested #25 also with:

  1. Windows 10:

    1. Firefox
    2. Chrome
    3. Microsoft Edge
  2. Windows 8.1:

    1. Firefox
    2. Chrome
    3. Internet Explorer 11
  3. Ubuntu 18.04:

    1. Firefox
    2. Chrome
  4. Safari on iOS 13.0
  5. Chrome for Android

It works as expected :) Could also anyone else confirm this?

jepster_’s picture

Status: Needs review » Reviewed & tested by the community

Tested successfully in firefox on macos. I could reach the focusable summary with the keyboard. Also I could reach all advanced widgets with the tabulator key and enter key. So it LGTM.

andrewmacpherson’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs accessibility review

@lauriii just asked for an accessibility review on Slack. The issue summary is vague, and doesn't describe the behaviour you're concerned with. So I'll take some time to read all the comments.

lauriii’s picture

Issue tags: +Needs reroll
andrewmacpherson’s picture

I chatted with @lauriii on Slack about this, but I'm still confused about exactly what the problem and resolution are.

This is tricky for me to review, because I don't have a working mac just now. (I normally do, but it stopped booting after the 10.15.1 upgrade.)

This issue needs more detail, please:

  • An explanation of what the problem is, and the workaround.
  • Steps to reproduce
  • Whether any macOS system settings make a difference. Comment #4 mentions an operating system preference, but doesn't say which one.
  • An explanation of what the animated GIFs are showing. I can't tell what user actions are taking place (keypresses, mouse clicks), but I can see the pointer move. It's also hard to follow because it loops, and I don't know where the start is, and the actions are fast.
andrewmacpherson’s picture

Are any other elements affected? The bugzilla report linked in #4 mentions checkboxes and radios.

How does Safari behave? The issue summary talks about inconsistency between Firefox and Chrome.

What is actually proposed here? #28 says it works as expected, but I can't tell what behaviour you are looking for.

huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
huzooka’s picture

huzooka’s picture

Uploading videos taken about W3Schools demo.

Pointer clicks are visible, every other actions are [tab/space/enter] key hits.

What you will notice:
Firefox on OS X shows summary's focus only if the summary was reached by keyboard navigation, and if it was expanded/collapsed by key events (hitting Space or Enter).
Even if the summary had the focus indication before, if the user clicks on it, the focus indication will be removed.

Every other browser, and even Firefox on other platforms (Windows, Ubuntu), this focus indication is visible for pointer events as well.

huzooka’s picture

Issue tags: -Needs reroll
huzooka’s picture

Attached two more videos.

  1. Firefox-OSX--with-workaround.mp4 shows how details summary focus works right now. This is exactly the same behavior that users (will) experience with other browsers.
  2. Details-focus--Firefox-Ubuntu.mp4 shows how Firefox on OS X manages details summary focus without the workaround (with patch #35).

    Other browsers and Firefox on other operating systems will keep having the same behavior that is illustrated by the previous point.

huzooka’s picture

Assigned: huzooka » Unassigned
Issue summary: View changes
Status: Needs work » Needs review

Re-rolled #35 and updated IS (#32).

Re #32:
I added some videos in #36 and in #38 that should clarify what this issue is about.

Re #33:

  1. No other elements were affected by the workaround that we plan to remove here.
  2. Safari does the same as any other browsers.
  3. Answered in the IS Problem/Motivation and in User interface changes
huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
Issue tags: +Needs reroll

Re-rolled #35

This is a lie.

huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new5.48 KB
lauriii’s picture

Component: Claro theme » javascript
Status: Needs review » Needs work
Issue tags: -Needs accessibility review

I walked through this with @andrewmacpherson earlier today. One of the concerns on this change was that whether the summary would be still focused after removing this code. We confirmed that the element is focused by moving focus elsewhere, opening a details element by clicking the summary, and continuing navigation by tabbing. The result was that I was able to continue tabbing inside the details element as expected even though the focus event didn't trigger. Therefore the normalization code isn't critical because the functionality works as expected. However, @andrewmacpherson thinks that having this normalization in place might be still desirable.

We agreed to open issue in the Firefox issue queue to try to see if there's a reason behind this inconsistency in Firefox. Based on that we could decide whether we wanted to keep this normalization in place or not. If we wanted to keep this, it should be moved from Claro to core so that all themes could benefit from it. From @andrewmacpherson / accessibility point of view, this doesn't have to be a stable blocker but instead, a should have.

Link to the Firefox issue I opened: https://bugzilla.mozilla.org/show_bug.cgi?id=1599415

kostyashupenko’s picture

Issue tags: -Needs reroll
andrewmacpherson’s picture

#42 Thanks for the summary of our test session @lauriii, both here and the new upstream Mozilla issue.

Comment #4 (and the Mozilla issue li) suggests that it's following an established macOS behaviour (and/or a setting), but I've not been able to verify what policy it's following (or which setting). The new issue you filed includes the important observation that Firefox is behaving differently to Safari, which casts doubt on the "following mac convention" claim.

Supporting user-agent and/or OS behaviours is generally a good idea, but in this case I think it's a poor experience for people who make mixed use of keyboard and mouse. So I think we should continue to normalize this across browsers. If we find a clearer explanation (or the name of a user setting) for Firefox's behaviour, that would be a different matter.

I suggest we keep the Claro workaround for now, and look at the best way to make it generic and robust.

I'm a little concerned that the current code might lead to focus events being fired twice in some cases. Focus usually comes after mousedown, but before click, so we could put in a check for the activeElement to avoid firing focus twice?

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

lauriii’s picture

Status: Needs work » Postponed

It seems like the upstream bug has been addressed: https://bugzilla.mozilla.org/show_bug.cgi?id=1599415. We can probably get rid of the workaround once there is a Firefox ESR release that ships with the bug fix.

lauriii’s picture

Status: Postponed » Active

It seems like FF 78 is an ESR so we could remove the workaround now.

bnjmnm’s picture

Status: Active » Needs review
StatusFileSize
new350.75 KB
new5.48 KB

This is a reroll of #41, which I manually confirmed still works, and can be seen in the attached gif.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sakthivel m’s picture

Status: Needs review » Needs work

#48 Patch Failed

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new5.44 KB

#52 Please review the patch

gauravvvv’s picture

I have added with a workaround and without workaround screen recording after patch #52.

I don't find any difference. Please let me know if I am doing something wrong.

chetanbharambe’s picture

StatusFileSize
new1.83 MB
new1.38 MB

I have tested this issue on Firefox.
The issue is not reproducible on the 9.3.x-dev version.
I have attached the video before and after applying the patch #52.

I don't find any difference. Please let me know if anything missed from my side.
Need +1 RTBC

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

tom konda made their first commit to this issue’s fork.

tom konda’s picture

I created issue fork branch and rerolled patch #52.

tom konda’s picture

Status: Needs work » Needs review

Change from patch #52:

  1. Remove jQuery calling in /claro/js/details.js
  2. Remove workaround for weird flash.

    I cannot reproduce comment #17 on 11.x branch and Firefox 146

  3. Remove :active pseudo class from selector for vertical tab.

Please review.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: -Needs issue summary update +fldc26

This one needs a rebase and manual testing. May be a good contribution item for fldc26