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(panel): tweak focusable content area #10141

Merged
merged 30 commits into from
Sep 4, 2024

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented Aug 22, 2024

Related Issue: #10022

Summary

Updates panel to have a single focusable container when it has scrolling content.

Noteworthy changes

  • Improves test coverage for both scrolling and non-scrolling content.
  • Updates disabled test helper to clear focus targets between tab and click tests

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Aug 22, 2024
@jcfranco jcfranco marked this pull request as ready for review August 27, 2024 08:17
Copy link
Contributor

@alisonailea alisonailea left a comment

Choose a reason for hiding this comment

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

🎉

@macandcheese
Copy link
Contributor

The conditionally-applied tab index looks great! And should apply to Tab most likely as well :)

I think we might need to explore some other options for showing the visual focus outline here - might require some fake containers / pseudo elements - this focusable area is hard to discern and has a lot of overlap with the content slotted inside:
Screenshot 2024-08-27 at 8 44 32 AM

Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

👍

@geospatialem geospatialem added this to the 2.12.1 patch milestone Sep 3, 2024
@jcfranco jcfranco requested a review from benelan as a code owner September 4, 2024 03:26
@jcfranco jcfranco added the skip visual snapshots Pull requests that do not need visual regression testing. label Sep 4, 2024
expect(calcitePanelClose).toHaveReceivedEventTimes(1);
});

it("should not close when Escape key is prevented and closable is true", async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

@driskull Due to the contents of scrollingContentHtml, this test is only covered under the scrolling use case.

We could add coverage for this test for both scrolling and non-scrolling content by adding focusable elements to the content. Does that approach make sense? If so, would we want to keep scrolling content and non-scrolling content as the main test groups or do we need an additional group to cover scrolling with and without interactive content?

@jcfranco jcfranco merged commit 3dd4b28 into dev Sep 4, 2024
10 checks passed
@jcfranco jcfranco deleted the jcfranco/10022-tidy-up-scroller-content-tabbing branch September 4, 2024 08:04
@jcfranco
Copy link
Member Author

jcfranco commented Sep 4, 2024

For posterity, after some extensive troubleshooting, it turns out that not having a set width/height was affecting disabled tests (namely this assertion from the prevents focusing via keyboard and mouse test) in the CI despite tests passing locally in both headless and headful modes for both macOS and Linux.

benelan pushed a commit that referenced this pull request Sep 4, 2024
**Related Issue:** #10022

## Summary

Updates `panel` to have a single focusable container when it has
scrolling content.

### Noteworthy changes

* Improves test coverage for both scrolling and non-scrolling content.
* Updates `disabled` test helper to clear focus targets between tab and
click tests
benelan pushed a commit that referenced this pull request Sep 4, 2024
**Related Issue:** #10022

## Summary

Updates `panel` to have a single focusable container when it has
scrolling content.

### Noteworthy changes

* Improves test coverage for both scrolling and non-scrolling content.
* Updates `disabled` test helper to clear focus targets between tab and
click tests
@benelan benelan mentioned this pull request Sep 4, 2024
benelan added a commit that referenced this pull request Sep 4, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>@esri/calcite-components: 2.12.1</summary>

##
[2.12.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2024-09-04)


### Bug Fixes

* **loader:** Restore animation
([#10184](#10184))
([52081ca](52081ca))
* **panel:** Tweak focusable content area
([#10141](#10141))
([fa18b70](fa18b70))
</details>

<details><summary>@esri/calcite-components-angular: 2.12.1</summary>

##
[2.12.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2024-09-04)


### Miscellaneous Chores

* **@esri/calcite-components-angular:** Synchronize components versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @esri/calcite-components bumped from 2.12.0 to 2.12.1
</details>

<details><summary>@esri/calcite-components-react: 2.12.1</summary>

##
[2.12.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2024-09-04)


### Miscellaneous Chores

* **@esri/calcite-components-react:** Synchronize components versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @esri/calcite-components bumped from 2.12.0 to 2.12.1
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
benelan added a commit that referenced this pull request Sep 4, 2024
🤖 I have created a release *beep* *boop*
---

<details><summary>@esri/calcite-components: 2.12.1</summary>

[2.12.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2024-09-04)

* **loader:** Restore animation
([#10184](#10184))
([52081ca](52081ca))
* **panel:** Tweak focusable content area
([#10141](#10141))
([fa18b70](fa18b70))
</details>

<details><summary>@esri/calcite-components-angular: 2.12.1</summary>

[2.12.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2024-09-04)

* **@esri/calcite-components-angular:** Synchronize components versions

* The following workspace dependencies were updated
  * dependencies
    * @esri/calcite-components bumped from 2.12.0 to 2.12.1
</details>

<details><summary>@esri/calcite-components-react: 2.12.1</summary>

[2.12.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2024-09-04)

* **@esri/calcite-components-react:** Synchronize components versions

* The following workspace dependencies were updated
  * dependencies
    * @esri/calcite-components bumped from 2.12.0 to 2.12.1
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
benelan added a commit that referenced this pull request Sep 4, 2024
🤖 I have created a release *beep* *boop*
---

<details><summary>@esri/calcite-components: 2.12.1</summary>


[2.12.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2024-09-04)

* **loader:** Restore animation
([#10184](#10184))

([52081ca](52081ca))
* **panel:** Tweak focusable content area
([#10141](#10141))

([fa18b70](fa18b70))
</details>

<details><summary>@esri/calcite-components-angular: 2.12.1</summary>


[2.12.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2024-09-04)

* **@esri/calcite-components-angular:** Synchronize components versions

* The following workspace dependencies were updated
  * dependencies
    * @esri/calcite-components bumped from 2.12.0 to 2.12.1
</details>

<details><summary>@esri/calcite-components-react: 2.12.1</summary>


[2.12.1](https://github.com/Esri/calcite-design-system/compare/@esri/[email protected]...@esri/[email protected])
(2024-09-04)

* **@esri/calcite-components-react:** Synchronize components versions

* The following workspace dependencies were updated
  * dependencies
    * @esri/calcite-components bumped from 2.12.0 to 2.12.1
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See

[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
jcfranco added a commit that referenced this pull request Sep 6, 2024
… align with browsers (#10242)

**Related Issue:** #10238

## Summary

Fixes a regression caused by #10141 where clicks on scrollers would show
the focus outline.

### Notes

* this behavior aligns with Chrome/Firefox's latest default focus on
scrolling content behavior
* `:focus-visible` [isn’t supported in Safari 15.0 -
15.3](https://caniuse.com/?search=focus-visible), but given Safari 18 is
expected this year, this is a minor visual inconsistency for unsupported
versions.
* cleans up focus styles that should have been updated by #10141.
* no tests were added as we currently don't cover interactive
focus-related styling
benelan pushed a commit that referenced this pull request Sep 9, 2024
… align with browsers (#10242)

**Related Issue:** #10238

## Summary

Fixes a regression caused by #10141 where clicks on scrollers would show
the focus outline.

### Notes

* this behavior aligns with Chrome/Firefox's latest default focus on
scrolling content behavior
* `:focus-visible` [isn’t supported in Safari 15.0 -
15.3](https://caniuse.com/?search=focus-visible), but given Safari 18 is
expected this year, this is a minor visual inconsistency for unsupported
versions.
* cleans up focus styles that should have been updated by #10141.
* no tests were added as we currently don't cover interactive
focus-related styling
benelan pushed a commit that referenced this pull request Sep 9, 2024
… align with browsers (#10242)

**Related Issue:** #10238

## Summary

Fixes a regression caused by #10141 where clicks on scrollers would show
the focus outline.

### Notes

* this behavior aligns with Chrome/Firefox's latest default focus on
scrolling content behavior
* `:focus-visible` [isn’t supported in Safari 15.0 -
15.3](https://caniuse.com/?search=focus-visible), but given Safari 18 is
expected this year, this is a minor visual inconsistency for unsupported
versions.
* cleans up focus styles that should have been updated by #10141.
* no tests were added as we currently don't cover interactive
focus-related styling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants