When I use the browser copy to clipboard function, the supplied text content should be copied to the clipboard.
Actual behavior
What actually happens?
It isn't copied to the clipboard and there is the following message in the console:
parser.js:729 Error calling method in expression: browser1.writeTextToClipboard('Hello World!') TypeError: Cannot read properties of undefined (reading 'writeText')
at s.writeTextToClipboard (browser.js:143:1)
at e.<anonymous> (BaseComponent.js:470:1)
at parser.js:727:1
at parser.js:469:1
at Object.parse (parser.js:404:1)
at HTMLButtonElement.<anonymous> (on.js:14:1)
at HTMLButtonElement.a (events.js:280:1)
at HTMLButtonElement.dispatch (jquery-3.4.1.min.js:2:42571)
at HTMLButtonElement.<anonymous> (jquery-3.4.1.min.js:2:40572)
The issue is the same locally using http://localhost/ on WAMP and on my server based test site.
The server is currently http rather than https.
Could being https make a difference do you think?
I'm using Chrome on Windows 11.
I was using other browser commands to do the copy and paste in 3.9.7:
browser1.selectAll();
browser1.copy();
These worked just fine on localhost using Chrome, but also now don't work in my 6.8.0 upgraded version... I don't know if they have been depreciated or not, but I assumed they had and so went on to use .writeTextToClipboard(), only to find that doesn't work either.
Shouldn't make a difference. I use it on internal PHP sites and it works just fine. To me it seems like your files are not being published to your target. What are you using for a staging/development target? Can you make sure all the files are there? Do a full publish.
I've created a new project with just an index file that contains the button and the brower components, and it still doesn't work... I feel like I have tried all I can do.
I will DM you a zip file of the complete project... can you load up the project and tell me what is wrong with it please?
Everything works fine with the files you sent me.
Are you sure you've cleared your browser cache and you don't have any old file cached?
Tested both on mac and windows in Chrome and works fine on both places.
I've done what you said and I still have the problem...
I've cleared the cache on Chrome and on Firefox, and I've put ?x=123 on the end of each call to the .js files to force them to be re-read (as shown below), and the error still occurs on both browsers.
Are you sure you aren't running some sort of app (Anti-Virus or Security) in the background that might be blocking it? Have you tried a different device? Seems to me this is 'possibly' an isolated issue rather than a Wappler issue.
Thanks for your thoughts on helping me out with this! I've tried different laptops, browsers I never use, incognito, and it still doesn't work for me...
I have uploaded that little page with the button to my new test server... could you each please tell me if it works for you from there?