fix: wiki page git repository URL copy function shows success but fails to copy
What does this MR do and why?
This MR fixes the issue of copy button not working on clone wiki modal.
Currently copy button only works when clone url is selected by the user. Directly clicking the copy button doesn't work. Even this was working on safari and not on Firefox while I checked.
I found out the ClipboardButton
behavior is interrupted somehow by GlModal
component since the copy button works properly when you remove the <gl-modal>
wrapper from the CloneWikiModal
component without any other code changes.
I've used navigator.clipboard.writeText
to handle this. even with that, it doesn't seems to be working on safari, so added .select
method to select the input element whose value is to be copied as well.
References
Screenshots or screen recordings
Before | After |
---|---|
Screen Recording 2025-10-02 at 13.53.25.mov | Screen Recording 2025-10-02 at 13.42.52.mov |
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.