mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fixing focus outline (#17863)
This commit is contained in:
parent
f57d10d857
commit
ae3cd97690
@ -10,7 +10,7 @@ exports[`FormTextField should render correctly 1`] = `
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
class="box mm-text mm-input mm-text-field__input mm-text--body-md mm-text--color-text-default box--padding-right-4 box--padding-left-4 box--flex-direction-row box--background-color-transparent box--border-style-none"
|
||||
class="box mm-text mm-input mm-input--disable-state-styles mm-text-field__input mm-text--body-md mm-text--color-text-default box--padding-right-4 box--padding-left-4 box--flex-direction-row box--background-color-transparent box--border-style-none"
|
||||
focused="false"
|
||||
type="text"
|
||||
value=""
|
||||
|
@ -11,7 +11,7 @@ exports[`TextFieldSearch should render correctly 1`] = `
|
||||
/>
|
||||
<input
|
||||
autocomplete="off"
|
||||
class="box mm-text mm-input mm-text-field__input mm-text--body-md mm-text--color-text-default box--margin-right-6 box--padding-right-4 box--padding-left-2 box--flex-direction-row box--background-color-transparent box--border-style-none"
|
||||
class="box mm-text mm-input mm-input--disable-state-styles mm-text-field__input mm-text--body-md mm-text--color-text-default box--margin-right-6 box--padding-right-4 box--padding-left-2 box--flex-direction-row box--background-color-transparent box--border-style-none"
|
||||
focused="false"
|
||||
type="search"
|
||||
value=""
|
||||
|
@ -7,7 +7,7 @@ exports[`TextField should render correctly 1`] = `
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
class="box mm-text mm-input mm-text-field__input mm-text--body-md mm-text--color-text-default box--padding-right-4 box--padding-left-4 box--flex-direction-row box--background-color-transparent box--border-style-none"
|
||||
class="box mm-text mm-input mm-input--disable-state-styles mm-text-field__input mm-text--body-md mm-text--color-text-default box--padding-right-4 box--padding-left-4 box--flex-direction-row box--background-color-transparent box--border-style-none"
|
||||
focused="false"
|
||||
type="text"
|
||||
value=""
|
||||
|
@ -135,6 +135,7 @@ export const TextField = ({
|
||||
required={required}
|
||||
value={value}
|
||||
type={type}
|
||||
disableStateStyles
|
||||
{...inputProps} // before className so input className isn't overridden
|
||||
className={classnames('mm-text-field__input', inputProps?.className)}
|
||||
/>
|
||||
|
@ -245,4 +245,14 @@ describe('TextField', () => {
|
||||
fireEvent.change(textField, { target: { value: '' } }); // reset value
|
||||
expect(textField.value).toBe(''); // value is empty string after reset
|
||||
});
|
||||
it('should render the child Input with disableStateStyles to prevent multiple focus outlines', async () => {
|
||||
const { getByTestId, user } = renderWithUserEvent(
|
||||
<TextField inputProps={{ 'data-testid': 'input' }} />,
|
||||
);
|
||||
const InputComponent = getByTestId('input');
|
||||
|
||||
await user.click(InputComponent);
|
||||
expect(getByTestId('input')).toHaveFocus();
|
||||
expect(getByTestId('input')).toHaveClass('mm-input--disable-state-styles');
|
||||
});
|
||||
});
|
||||
|
@ -98,7 +98,7 @@ exports[`Reveal Seed Page should match snapshot 1`] = `
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
class="box mm-text mm-input mm-text-field__input mm-text--body-md mm-text--color-text-default box--padding-right-4 box--padding-left-4 box--flex-direction-row box--background-color-transparent box--border-style-none"
|
||||
class="box mm-text mm-input mm-input--disable-state-styles mm-text-field__input mm-text--body-md mm-text--color-text-default box--padding-right-4 box--padding-left-4 box--flex-direction-row box--background-color-transparent box--border-style-none"
|
||||
data-testid="input-password"
|
||||
focused="true"
|
||||
id="password-box"
|
||||
|
Loading…
x
Reference in New Issue
Block a user