Skip to content

Commit 32e01b8

Browse files
Fix tab navigation for InputWithCopy (#18009)
* Fix tab navigation for `InputWithCopy` * Fix focus positioning
1 parent fba93b7 commit 32e01b8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

components/dashboard/src/components/InputWithCopy.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ export function InputWithCopy(props: { value: string; tip?: string; className?:
2727
type="text"
2828
value={props.value}
2929
/>
30-
<div className="cursor-pointer" onClick={() => handleCopyToClipboard(props.value)}>
31-
<div className="absolute top-1/3 right-3">
32-
<Tooltip content={copied ? "Copied" : tip}>
33-
<img src={copy} alt="copy icon" title={tip} />
34-
</Tooltip>
35-
</div>
36-
</div>
30+
<button className="reset absolute top-1/3 right-3" onClick={() => handleCopyToClipboard(props.value)}>
31+
<Tooltip content={copied ? "Copied" : tip}>
32+
<img src={copy} alt="copy icon" title={tip} />
33+
</Tooltip>
34+
</button>
3735
</div>
3836
);
3937
}

components/dashboard/src/index.css

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@
5555
button {
5656
@apply cursor-pointer px-4 py-2 my-auto bg-green-600 dark:bg-green-700 hover:bg-green-700 dark:hover:bg-green-600 text-gray-100 dark:text-green-100 text-sm font-medium rounded-md focus:outline-none focus:ring transition ease-in-out;
5757
}
58+
button.reset {
59+
@apply bg-transparent hover:bg-transparent font-normal rounded-none;
60+
padding: unset;
61+
text-align: start;
62+
}
5863
button.secondary {
5964
@apply bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-500 dark:text-gray-100 hover:text-gray-600;
6065
}

0 commit comments

Comments
 (0)