jongacnik / kirby-fields-block

Kirby block preview plugin to directly render block fields
MIT License
109 stars 5 forks source link

improve: enable select text by dblclick #9

Closed dennisbaum closed 2 years ago

dennisbaum commented 2 years ago

at first, i would like to thank you for that nice plugin! i tried to fix the issue that editors can not select text by doubleclick.
in the first try, i checked the tagName of the mousedown-event's target.
i add a condition to only preventDefault, if tagName is not input or text-area. unfortenetly there are some more tags, if for example a writer field is included in the block.

second iteration i checked the event's target for an ancestor of type '.k-input' i changed the condition to only preventDefault, if there is none. we tested with text, textarea, url, writer with text, code, link.... thats works quite nicely.

would be nice, if you can have a look. Thx.

tobimori commented 2 years ago

tested this, would be great to have this merged!

jongacnik commented 2 years ago

Hey thanks for your work on this!