Skip to content

Conversation

@zakwarsame
Copy link
Contributor

@zakwarsame zakwarsame commented Aug 30, 2023

WHY are these changes introduced?

Fixes https://github.com/Shopify/core-workflows/issues/1020

  • Currently when navigating to a given index table with the query included in the URL, the input field will contain the value but will not be focused
  • Since only indexes containing queries have the state of mode as Filtering, we dynamically initialize with it. This way when the URL includes a query, the input field is focused without accessibility trade-offs.
Specifications

image

WHAT is this pull request doing?

  • This PR sets the initial focus of the input fields to true when IndexFiltersMode is Filtering.

How to 🎩

🎩 checklist

@zakwarsame zakwarsame marked this pull request as ready for review September 5, 2023 15:38
@zakwarsame zakwarsame mentioned this pull request Sep 5, 2023
4 tasks
@zakwarsame zakwarsame requested a review from chloerice September 6, 2023 17:31
Co-authored-by: Chloe Rice <chloerice@users.noreply.github.com>
@zakwarsame zakwarsame merged commit eba75d2 into main Sep 6, 2023
@zakwarsame zakwarsame deleted the index/focus branch September 6, 2023 19:59
kyledurand pushed a commit that referenced this pull request Sep 7, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/polaris-icons@7.9.0

### Minor Changes

- [#9856](#9856)
[`47652f7d6`](47652f7)
Thanks [@heyjoethomas](https://github.com/heyjoethomas)! - Updates
social media icons, removing them from their containers and adds a one
for the Twitch platform.

## @shopify/polaris-migrator@0.22.0

### Minor Changes

- [#10263](#10263)
[`67699cb88`](67699cb)
Thanks [@aveline](https://github.com/aveline)! - Added migration for
`Button` component

## @shopify/polaris@11.15.0

### Minor Changes

- [#9701](#9701)
[`cbf539495`](cbf5394)
Thanks [@martenbjork](https://github.com/martenbjork)! - Updated the
Frame and Topbar components to stay clear of a scrollbar. This reduces
the overall jumpiness in the UI when scrollbars appear and disappear
when using a Polaris app.

### Patch Changes

- [#10284](#10284)
[`eba75d20a`](eba75d2)
Thanks [@zakwarsame](https://github.com/zakwarsame)! - - Updated
`Filters` query field to initialize with focus based on `mode` state


- [#10282](#10282)
[`9a2d4f62a`](9a2d4f6)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fixed pointer
alignment on tooltip


- [#10343](#10343)
[`12a62b4d7`](12a62b4)
Thanks [@mrcthms](https://github.com/mrcthms)! - Fixed UI
inconsistencies in the mobile view of the IndexFilters


- [#10276](#10276)
[`abb50250e`](abb5025)
Thanks [@highfieldjames](https://github.com/highfieldjames)! - Updated
`TextField` of `type` `number` to focus when a `Spinner` button is
clicked

- Updated dependencies
\[[`47652f7d6`](47652f7)]:
    -   @shopify/polaris-icons@7.9.0

## polaris.shopify.com@0.57.3

### Patch Changes

- Updated dependencies
\[[`47652f7d6`](47652f7),
[`eba75d20a`](eba75d2),
[`9a2d4f62a`](9a2d4f6),
[`12a62b4d7`](12a62b4),
[`cbf539495`](cbf5394),
[`abb50250e`](abb5025)]:
    -   @shopify/polaris-icons@7.9.0
    -   @shopify/polaris@11.15.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@chloerice chloerice added 2023 Contribution tracking for 2023 Contribution Tracking contribution in conjuction with year and type, e.g., "Component" + "Contribution" + "2023" labels Dec 5, 2023
AnnaCheba pushed a commit to AnnaCheba/polaris that referenced this pull request Apr 22, 2024
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes https://github.com/Shopify/core-workflows/issues/1020

<!--
  Context about the problem that’s being addressed.
-->

- Currently when navigating to a given index table with the query
included in the URL, the input field will contain the value but will not
be focused
- Since only indexes containing queries have the state of `mode` as
Filtering, we dynamically initialize with it. This way when the URL
includes a query, the input field is focused without accessibility
trade-offs.

<details>
<summary> Specifications </summary>


![image](https://github.com/Shopify/polaris/assets/42528878/a576e9a7-7016-48be-a146-1a8b4d40cfb2)
</details>

### WHAT is this pull request doing?

<!--
  Summary of the changes committed.

Before / after screenshots are appreciated for UI changes. Make sure to
include alt text that describes the screenshot.

If you include an animated gif showing your change, wrapping it in a
details tag is recommended. Gifs usually autoplay, which can cause
accessibility issues for people reviewing your PR:

    <details>
      <summary>Summary of your gif(s)</summary>
      <img src="..." alt="Description of what the gif shows">
    </details>
-->

<!-- ℹ️ Delete the following for small / trivial changes -->

- This PR sets the initial focus of the input fields to true when
`IndexFiltersMode` is `Filtering`.


### How to 🎩

- [Spin URL containing
query](https://admin.web.hadf.zakaria-warsame.us.spin.dev/store/shop1/products?query=aero)
- Ensure the input is focused when you go to the page or refresh with
the query included



### 🎩 checklist

- [x] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [x] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
~- [ ] Updated the component's `README.md` with documentation changes~ 
- [x] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide

---------

Co-authored-by: Chloe Rice <chloerice@users.noreply.github.com>
ascherkus pushed a commit to ascherkus/polaris that referenced this pull request Feb 19, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/polaris-icons@7.9.0

### Minor Changes

- [Shopify#9856](Shopify#9856)
[`47652f7d6`](Shopify@5443369)
Thanks [@heyjoethomas](https://github.com/heyjoethomas)! - Updates
social media icons, removing them from their containers and adds a one
for the Twitch platform.

## @shopify/polaris-migrator@0.22.0

### Minor Changes

- [Shopify#10263](Shopify#10263)
[`67699cb88`](Shopify@3584b03)
Thanks [@aveline](https://github.com/aveline)! - Added migration for
`Button` component

## @shopify/polaris@11.15.0

### Minor Changes

- [Shopify#9701](Shopify#9701)
[`cbf539495`](Shopify@f95f366)
Thanks [@martenbjork](https://github.com/martenbjork)! - Updated the
Frame and Topbar components to stay clear of a scrollbar. This reduces
the overall jumpiness in the UI when scrollbars appear and disappear
when using a Polaris app.

### Patch Changes

- [Shopify#10284](Shopify#10284)
[`eba75d20a`](Shopify@5dfc913)
Thanks [@zakwarsame](https://github.com/zakwarsame)! - - Updated
`Filters` query field to initialize with focus based on `mode` state


- [Shopify#10282](Shopify#10282)
[`9a2d4f62a`](Shopify@8b6b12e)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fixed pointer
alignment on tooltip


- [Shopify#10343](Shopify#10343)
[`12a62b4d7`](Shopify@a7b16c6)
Thanks [@mrcthms](https://github.com/mrcthms)! - Fixed UI
inconsistencies in the mobile view of the IndexFilters


- [Shopify#10276](Shopify#10276)
[`abb50250e`](Shopify@31df1db)
Thanks [@highfieldjames](https://github.com/highfieldjames)! - Updated
`TextField` of `type` `number` to focus when a `Spinner` button is
clicked

- Updated dependencies
\[[`47652f7d6`](Shopify@5443369)]:
    -   @shopify/polaris-icons@7.9.0

## polaris.shopify.com@0.57.3

### Patch Changes

- Updated dependencies
\[[`47652f7d6`](Shopify@5443369),
[`eba75d20a`](Shopify@5dfc913),
[`9a2d4f62a`](Shopify@8b6b12e),
[`12a62b4d7`](Shopify@a7b16c6),
[`cbf539495`](Shopify@f95f366),
[`abb50250e`](Shopify@31df1db)]:
    -   @shopify/polaris-icons@7.9.0
    -   @shopify/polaris@11.15.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2023 Contribution tracking for 2023 Component Contribution Tracking contribution in conjuction with year and type, e.g., "Component" + "Contribution" + "2023"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants