show Copied to clipboard tooltip message
Suggestion
I was wondering if there is a way we can have a tooltip showing "Copied!" or "Copied to clipboard!" when a user click on the copy icon. Use case
this will help accessibility and help the user knows the field has been copied and they don't have to double click to "make sure"
You can pass a function to the enableClipboard prop to provide any type of notification you like :)
See the demo for an example, which uses Toast notifications.
Here's the relevant documentation: https://carlosnz.github.io/json-edit-react/
I'm not using Toast Notifications. I just have a normal tooltip component and would like to render that only for the fields that was copied.
Hi @Neica, I'm not quite sure what you mean. What do you mean "a normal tooltip component"? Do you mean the tooltip that shows up in the component when you hover over a button? If so, changing the value of that won't cause it to re-render, and it's not standard usage to update tooltip content dynamically like that.
The intention of the enableCliboard callback is so you could provide any kind of feedback you like without this component needing to be opinionated about it.