Loading
Migrate navigator.clipboard in reference bubble menu to copyToClipboard
What does this MR do and why?
The reference bubble menu copy button called navigator.clipboard.writeText directly, which fails in non-secure contexts.
This follows the work in !211222 (merged), which blocks direct use of navigator.clipboard. The component now uses the shared helper copyToClipboard from ~/lib/utils/copy_to_clipboard and the matching eslint-disable comment is removed. The spec now mocks copyToClipboard instead of spying on navigator.clipboard.
Closes #579483.
References
Part of epic &19827.
Screenshots or screen recordings
Not applicable — no visual change.
How to set up and validate locally
- Run
yarn jest spec/frontend/content_editor/components/bubble_menus/reference_bubble_menu_spec.js.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.
This contribution was prepared with the help of an AI assistant. I reviewed the changes and take responsibility for them.