How to use decoration widget as a function arguments

I know to create a placeholder widget , but I don’t know how to handle click and highlight that widget , I use the widget in a function argument as a placeholder when user click the widget the widget should highlight and when start typing the widget should remove and replace with text that user type is possible to do this?

thanks,

You could add a mousedown handler to the widget that causes its extent to be selected, and set up the plugin that displays these to render those that are precisely selected as highlighted.

1 Like

I know how to do that but I don’t know how to deselect other widget that not click , sorry I’m very new to CodeMirror .

Hi @pitsanupotajan, I’m also trying to create similar widgets, but very unclear about how to do it. Could you please share the code somehow?

Thanks!