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

[ActionList.SearchField] Fix text and focus styles #10287

Merged
merged 2 commits into from
Aug 31, 2023

Conversation

laurkim
Copy link
Contributor

@laurkim laurkim commented Aug 31, 2023

WHY are these changes introduced?

Fixes focus ring and text input styles on ActionList.SearchField with beta flag enabled.

WHAT is this pull request doing?

  • Fixes focus ring styling
  • FIxes text color on input
    ActionList with search — before ActionList with search — before
    ActionList with search — after ActionList with search — after

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

Copy-paste this new story code in ActionList.stories.tsx to test:
export function WithSearch() {
  const [active, setActive] = useState(true);

  const toggleActive = useCallback(() => setActive((active) => !active), []);

  const activator = (
    <Button onClick={toggleActive} disclosure>
      More actions
    </Button>
  );

  return (
    <div style={{height: '250px'}}>
      <Popover
        active={active}
        activator={activator}
        autofocusTarget="first-node"
        onClose={toggleActive}
      >
        <ActionList
          actionRole="menuitem"
          sections={[
            {
              items: [
                {content: 'Import file', icon: ImportMinor},
                {content: 'Export file', icon: ExportMinor},
              ],
            },
            {
              items: [
                {content: 'Edit', icon: EditMinor},
                {content: 'Delete', icon: DeleteMinor},
              ],
            },
            {
              items: [
                {
                  content: 'Blog posts',
                  helpText: 'Manage your blog articles',
                },
                {
                  content: 'Blogs',
                  helpText: 'Manage blogs published to your Online Store',
                },
                {
                  active: true,
                  content: 'Active blogs',
                  helpText: 'This is helpful text',
                  icon: ImportMinor,
                  suffix: <Icon source={TickSmallMinor} />,
                },
                {
                  disabled: true,
                  content: 'Disabled blogs',
                  helpText: 'This is also helpful text',
                  icon: ImportMinor,
                  suffix: <Icon source={TickSmallMinor} />,
                },
              ],
            },
          ]}
        />
      </Popover>
    </div>
  );
}

🎩 checklist

@laurkim laurkim added Bug Something is broken and not working as intended in the system. Uplift polish Fast follow fixes and polish post Summer Editions labels Aug 31, 2023
@laurkim laurkim self-assigned this Aug 31, 2023
@laurkim laurkim marked this pull request as ready for review August 31, 2023 16:22
Copy link
Contributor

@MaxCloutier MaxCloutier left a comment

Choose a reason for hiding this comment

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

LGTM

@laurkim laurkim merged commit 9b14e23 into main Aug 31, 2023
23 checks passed
@laurkim laurkim deleted the lo/action-list-search-field-fix branch August 31, 2023 16:34
kyledurand pushed a commit that referenced this pull request Aug 31, 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-migrator@0.21.0

### Minor Changes

- [#10246](#10246)
[`1947b4691`](1947b46)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added the ability
to migrate prop values

### Patch Changes

- [#10215](#10215)
[`e4a6d47ab`](e4a6d47)
Thanks [@aveline](https://github.com/aveline)! - Fixed a bug in the
rename prop migration

## @shopify/polaris@11.14.0

### Minor Changes

- [#9907](#9907)
[`ef7ddb4ac`](ef7ddb4)
Thanks [@MaxCloutier](https://github.com/MaxCloutier)! - Add a search
field to filter ActionList that have more than 10 items

### Patch Changes

- [#10288](#10288)
[`cd1578230`](cd15782)
Thanks [@ssetem](https://github.com/ssetem)! - Only apply apple dynamic
text to mobile breakpoint


- [#10292](#10292)
[`72f55e32f`](72f55e3)
Thanks [@kyledurand](https://github.com/kyledurand)! - Added check for
string type before calling string method


- [#10211](#10211)
[`ac044b3c9`](ac044b3)
Thanks [@peterlazzarino](https://github.com/peterlazzarino)! - Ensure
Avatar has no background color if an source prop is passed in to allow
for transparent images


- [#10287](#10287)
[`9b14e231a`](9b14e23)
Thanks [@laurkim](https://github.com/laurkim)! - Fixed focus ring and
input text styles on `ActionList.SearchField` component

## polaris.shopify.com@0.57.2

### Patch Changes

- Updated dependencies
\[[`ef7ddb4ac`](ef7ddb4),
[`cd1578230`](cd15782),
[`72f55e32f`](72f55e3),
[`ac044b3c9`](ac044b3),
[`9b14e231a`](9b14e23)]:
    -   @shopify/polaris@11.14.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AnnaCheba pushed a commit to AnnaCheba/polaris that referenced this pull request Apr 22, 2024
### WHY are these changes introduced?

Fixes focus ring and text input styles on ActionList.SearchField with
beta flag enabled.

### WHAT is this pull request doing?

- Fixes focus ring styling
- FIxes text color on input
    <details>
      <summary>ActionList with search — before</summary>
<img
src="https://github.com/Shopify/polaris/assets/26749317/e31a6b6b-6ca5-46f3-a240-ef1a76ae42cb"
alt="ActionList with search — before">
    </details>
    <details>
      <summary>ActionList with search — after</summary>
<img
src="https://github.com/Shopify/polaris/assets/26749317/c7e7c729-3d55-4ffb-937f-7df379a15d10"
alt="ActionList with search — after">
    </details>

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

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this new story code in
<code>ActionList.stories.tsx</code> to test:</summary>

```jsx

export function WithSearch() {
  const [active, setActive] = useState(true);

  const toggleActive = useCallback(() => setActive((active) => !active), []);

  const activator = (
    <Button onClick={toggleActive} disclosure>
      More actions
    </Button>
  );

  return (
    <div style={{height: '250px'}}>
      <Popover
        active={active}
        activator={activator}
        autofocusTarget="first-node"
        onClose={toggleActive}
      >
        <ActionList
          actionRole="menuitem"
          sections={[
            {
              items: [
                {content: 'Import file', icon: ImportMinor},
                {content: 'Export file', icon: ExportMinor},
              ],
            },
            {
              items: [
                {content: 'Edit', icon: EditMinor},
                {content: 'Delete', icon: DeleteMinor},
              ],
            },
            {
              items: [
                {
                  content: 'Blog posts',
                  helpText: 'Manage your blog articles',
                },
                {
                  content: 'Blogs',
                  helpText: 'Manage blogs published to your Online Store',
                },
                {
                  active: true,
                  content: 'Active blogs',
                  helpText: 'This is helpful text',
                  icon: ImportMinor,
                  suffix: <Icon source={TickSmallMinor} />,
                },
                {
                  disabled: true,
                  content: 'Disabled blogs',
                  helpText: 'This is also helpful text',
                  icon: ImportMinor,
                  suffix: <Icon source={TickSmallMinor} />,
                },
              ],
            },
          ]}
        />
      </Popover>
    </div>
  );
}
```

</details>

### 🎩 checklist

- [ ] 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)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system. Uplift polish Fast follow fixes and polish post Summer Editions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants