Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Conversation

matallo
Copy link
Contributor

@matallo matallo commented Apr 20, 2023

WHY are these changes introduced?

Fixes an error when using Modal component with testing libraries.

Error: Uncaught [SyntaxError: ':disabled):not([aria-disabled="true"]' is not a valid selector]

WHAT is this pull request doing?

Order of selectors for button:not(:disabled):not([aria-disabled="true"]):not([tabindex="-1"]) was returning an error, and needed :not(:disabled) to be used last.

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

Copy-paste this code in playground/Playground.tsx:
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}

🎩 checklist

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
polaris-react-cjs 240.61 KB (0%)
polaris-react-esm 156.76 KB (-0.01% 🔽)
polaris-react-esnext 218.97 KB (-0.01% 🔽)
polaris-react-css 47.24 KB (0%)

@acmertz
Copy link
Contributor

acmertz commented Apr 20, 2023

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @acmertz! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/polaris-cli@0.0.0-snapshot-release-20230420205546
yarn add @shopify/polaris@0.0.0-snapshot-release-20230420205546

Copy link
Contributor

@acmertz acmertz left a comment

Choose a reason for hiding this comment

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

LGTM! I used the snapshot from #9039 (comment) to test this in web and confirm that the fix from #7831 still works.

@jesstelford jesstelford merged commit cda94e7 into main Apr 24, 2023
@jesstelford jesstelford deleted the matallo/fix-focus-selector-order branch April 24, 2023 11:12
kyledurand pushed a commit that referenced this pull request Apr 24, 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@10.47.2

### Patch Changes

- [#9039](#9039)
[`cda94e7a6`](cda94e7)
Thanks [@matallo](https://github.com/matallo)! - Updated the focus
helper functions, order of selectors for
`button:not(:disabled):not([aria-disabled="true"]):not([tabindex="-1"])`
was returning an error, moved `:not(:disabled)` to the end.

## @shopify/polaris-cli@0.1.33



## polaris.shopify.com@0.50.3

### Patch Changes

- Updated dependencies
\[[`cda94e7a6`](cda94e7)]:
    -   @shopify/polaris@10.47.2

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
juzser pushed a commit to juzser/polaris that referenced this pull request Jul 27, 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@10.47.2

### Patch Changes

- [Shopify#9039](Shopify#9039)
[`cda94e7a6`](Shopify@cda94e7)
Thanks [@matallo](https://github.com/matallo)! - Updated the focus
helper functions, order of selectors for
`button:not(:disabled):not([aria-disabled="true"]):not([tabindex="-1"])`
was returning an error, moved `:not(:disabled)` to the end.

## @shopify/polaris-cli@0.1.33



## polaris.shopify.com@0.50.3

### Patch Changes

- Updated dependencies
\[[`cda94e7a6`](Shopify@cda94e7)]:
    -   @shopify/polaris@10.47.2

Co-authored-by: github-actions[bot] <github-actions[bot]@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@10.47.2

### Patch Changes

- [Shopify#9039](Shopify#9039)
[`cda94e7a6`](Shopify@abc170f)
Thanks [@matallo](https://github.com/matallo)! - Updated the focus
helper functions, order of selectors for
`button:not(:disabled):not([aria-disabled="true"]):not([tabindex="-1"])`
was returning an error, moved `:not(:disabled)` to the end.

## @shopify/polaris-cli@0.1.33



## polaris.shopify.com@0.50.3

### Patch Changes

- Updated dependencies
\[[`cda94e7a6`](Shopify@abc170f)]:
    -   @shopify/polaris@10.47.2

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

Successfully merging this pull request may close these issues.

3 participants