fix(ui): gate copy button on clipboard API support

Only show the copy control when isSecureContext and clipboard.writeText
are available, and style the empty internal hostname state as a readonly
input to match adjacent fields.
This commit is contained in:
Andras Bacsai committed 2026-08-06 13:58:33 +02:00
1 parent 9fd2a21f24
commit a6ab360ac2
4 files changed
+15 -9

No files matched your search

@@ -38,7 +38,9 @@ it('renders copy fields as visible readonly controls with an accessible copy act
expect($html)
->toContain('label class="flex gap-1 items-center mb-1 text-sm font-medium text-black dark:text-white"')
->toContain('readonly')
->toContain('input-with-copy-button')
->toContain("canCopy: window.isSecureContext && typeof navigator.clipboard?.writeText === 'function'")
->toContain("x-bind:class=\"{ 'input-with-copy-button': canCopy }\"")
->toContain('x-show="canCopy"')
->toContain('copy-button')
->toContain('aria-label="Copy to clipboard"')
->toContain('title="Copy to clipboard"')