Skip to content

Commit f44943f

Browse files
committed
Fix password suffix alignment
1 parent 7b1a5c2 commit f44943f

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

packages/dataviews/src/dataform-controls/password.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import { Button } from '@wordpress/components';
4+
import {
5+
__experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,
6+
Button,
7+
} from '@wordpress/components';
58
import { useCallback, useState } from '@wordpress/element';
69
import { __ } from '@wordpress/i18n';
710
import { seen, unseen } from '@wordpress/icons';
@@ -34,17 +37,19 @@ export default function Password< Item >( {
3437
validity,
3538
type: isVisible ? 'text' : 'password',
3639
suffix: (
37-
<Button
38-
icon={ isVisible ? unseen : seen }
39-
onClick={ toggleVisibility }
40-
size="small"
41-
variant="tertiary"
42-
aria-label={
43-
isVisible
44-
? __( 'Hide password' )
45-
: __( 'Show password' )
46-
}
47-
/>
40+
<InputControlSuffixWrapper variant="control">
41+
<Button
42+
icon={ isVisible ? unseen : seen }
43+
onClick={ toggleVisibility }
44+
size="small"
45+
variant="tertiary"
46+
aria-label={
47+
isVisible
48+
? __( 'Hide password' )
49+
: __( 'Show password' )
50+
}
51+
/>
52+
</InputControlSuffixWrapper>
4853
),
4954
} }
5055
/>

0 commit comments

Comments
 (0)