-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add isFocusVisible useMenuItem and fix focusRing when typing in …
…Autocomplete SearchField (#7625) * add isFocusVisible support to useMenuItem * Adding tests and style in storybook * fix: (WIP) Fix autocomplete searchfield focus ring (#7626) * for discussion * fix searchfield focus ring appearing on keypress when wrapped in a autocomplete * add test * remove extranous controls
- Loading branch information
Showing
8 changed files
with
120 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2025 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
|
||
import {Menu, MenuItem, SearchField} from '../src'; | ||
import {pointerMap, render} from '@react-spectrum/test-utils-internal'; | ||
import React from 'react'; | ||
import {UNSTABLE_Autocomplete} from 'react-aria-components'; | ||
import userEvent from '@testing-library/user-event'; | ||
|
||
describe('SearchField', () => { | ||
let user; | ||
beforeAll(() => { | ||
user = userEvent.setup({delay: null, pointerMap}); | ||
}); | ||
|
||
it('should not apply the focus visible styles on the group when typing in the Autocomplete wrapped SearchField', async () => { | ||
let {getByRole} = render( | ||
<UNSTABLE_Autocomplete> | ||
<SearchField autoFocus label="Search" /> | ||
<Menu aria-label="test menu"> | ||
<MenuItem>Foo</MenuItem> | ||
<MenuItem>Bar</MenuItem> | ||
<MenuItem>Baz</MenuItem> | ||
</Menu> | ||
</UNSTABLE_Autocomplete> | ||
); | ||
|
||
let input = getByRole('searchbox'); | ||
await user.click(input); | ||
let group = getByRole('group'); | ||
expect(group).not.toHaveAttribute('data-focus-visible'); | ||
await user.keyboard('Foo'); | ||
expect(group).not.toHaveAttribute('data-focus-visible'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9bb6ed9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verdaccio builds:
CRA Test App
NextJS Test App
RAC Tailwind Example
RAC Spectrum + Tailwind Example
S2 Parcel Example
S2 Webpack Example
CRA Test App Size
NextJS App Size
Publish stats
Size diff since last release
Docs
Storybook
S2 Storybook