Problem
src/components/AddressDisplay.tsx copies the wallet address using the Clipboard API with a silent catch:
navigator.clipboard.writeText(address).catch(() => {
/* fallback */
});
The comment says "fallback" but there is no actual fallback implementation. navigator.clipboard requires a secure context (HTTPS). In HTTP environments — local dev served over plain HTTP, CI preview deployments, or embedded webviews — navigator.clipboard is undefined and the copy button silently does nothing. Users get no feedback that the copy failed.
A second problem in the same file: the copy button element has no aria-label. Screen readers announce it as an unlabeled button, giving keyboard and assistive-technology users no indication of what the button does or which address it will copy.
Solution
- Add a
document.execCommand('copy') fallback via a temporary <textarea> element for non-HTTPS contexts:
navigator.clipboard.writeText(address).catch(() => {
const el = document.createElement('textarea');
el.value = address;
el.style.position = 'fixed';
el.style.opacity = '0';
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
});
- Add
aria-label={copied ? 'Copied!' : 'Copy address to clipboard'} to the button.
Acceptance Criteria
Note for Contributors: If you're assigned to this issue, write a clear and detailed description for your pull request. Explain what was changed, why it was needed, how it was implemented, and include any relevant testing or screenshots where applicable.
Problem
src/components/AddressDisplay.tsxcopies the wallet address using the Clipboard API with a silent catch:The comment says "fallback" but there is no actual fallback implementation.
navigator.clipboardrequires a secure context (HTTPS). In HTTP environments — local dev served over plain HTTP, CI preview deployments, or embedded webviews —navigator.clipboardisundefinedand the copy button silently does nothing. Users get no feedback that the copy failed.A second problem in the same file: the copy button element has no
aria-label. Screen readers announce it as an unlabeled button, giving keyboard and assistive-technology users no indication of what the button does or which address it will copy.Solution
document.execCommand('copy')fallback via a temporary<textarea>element for non-HTTPS contexts:aria-label={copied ? 'Copied!' : 'Copy address to clipboard'}to the button.Acceptance Criteria
aria-labelthat updates after a successful copy