Topic: Clipboard not working in Modalwindow

jseird priority asked 5 months ago


Expected behavior Using the clipboard method with a button and input that are located within a modal window should also copy the value of the input into the clipboard.

Actual behavior Nothing is copied to the clipboard. The event listener, as provided in the sample, is working fine. It also outputs the correct value. However nothing is copied to the clipboard, the intended function of that method. Pasting the clipboard returns an empty value or still contains the value that has been copied manually before using the clipboard method.

Resources (screenshots, code snippets etc.) https://mdbootstrap.com/docs/standard/methods/clipboard/#section-feedback-example

Obviously this is due to some focus things of the bootstrap framework. Other clipboard libs allow for setting the 'base-container' so that the value is copied to the clipboard. Did not find such a possibility


Kamila Pieńkowska staff answered 5 months ago


Sorry, there was a typo in the ID of the input in the clipboard example.

Here is a working example: https://mdbootstrap.com/snippets/standard/kpienkowska/5808466#js-tab-view


jseird priority commented 5 months ago

Hi there, this does not work in Safari - Still the very same problem like mentioned above; nothing is copied to the clipboard. as a workaround I use navigator.clipboard.writeText(valueToCopy) within the copied.mdb.clipboard event and do pass the text here. however this should be addressed in the mdb lib in the first place though.


Kamila Pieńkowska staff commented 5 months ago

This is a bug and we need to fix it.


jseird priority commented 2 months ago

Any news on the fix timeline?


Kamila Pieńkowska staff commented 2 months ago

We do not provide dates or content for future releases beforehand.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 7.0.0
  • Device: All
  • Browser: Safari
  • OS: macOS, iOS
  • Provided sample code: No
  • Provided link: Yes