I'm experiencing an issue with a copy-to-clipboard functionality in JavaScript. The feature works perfectly on desktop browsers (tested on Chrome, Firefox, and Edge), but it does not work on mobile browsers, including Chrome and Safari on both iOS and Android.
When I click the button on a desktop browser, the text is successfully copied to the clipboard, and I receive a confirmation (e.g., an alert or visual feedback). However, when I perform the same action on a mobile browser, the feedback still appears (indicating success), but the text is not actually copied to the clipboard.
I’ve tried ensuring compatibility by making the element selectable and testing across different devices and browsers. Despite my efforts, it seems that the issue is specific to mobile environments.
Has anyone else faced a similar problem? Are there known limitations or alternative solutions for reliably copying text to the clipboard on mobile devices? Any insights or recommendations would be greatly appreciated!