verbb / vizy

A flexible visual editor for Craft CMS
Other
44 stars 8 forks source link

Mouse cursor is not functioning properly in nested Vizy field. #267

Closed dialedin-team closed 10 months ago

dialedin-team commented 10 months ago

Describe the bug

Recenty i have upgraded craft cms version from 4.5.6.1 to 4.5.9, i noticed that mouse selection is not working properly when using fields inside a Vizy field and also when i double click outside of the field, the text cursor not showing in vizy field Ref video: https://github.com/verbb/vizy/assets/148037067/86332d29-2491-419d-a8d9-251b2874aa83

Steps to reproduce

  1. The mouse cursor is not functioning properly when fields inside vizy field

Craft CMS version

4.5.9

Plugin version

2.1.11 and also 2.1.12

engram-design commented 10 months ago

I believe this is a known issue with Tiptap and that fact that the Vizy block node has draggable: true, which makes double-clicking or highlighting text in some areas not work. This can be confirmed by changing https://github.com/verbb/vizy/blob/1546cc432f23dc594ce4cf6162db12fdc0d8d04c/src/web/assets/field/src/js/components/input/VizyBlock.js#L12

But that's not an option, as it would disable dragging Vizy blocks to re-order. Will raise with Tiptap. Related to https://github.com/ueberdosis/tiptap/issues/1133

thangaraj-moorthi commented 10 months ago

Hi @engram-design So, if I'm understanding correctly, we're facing either a dragging issue or a click issue. Is it not possible to address and resolve both of these problems? I appreciate your clarification.

engram-design commented 10 months ago

It’s both, the cursor issue is due to the Tiptap component being draggable.

still looking into options to address it.

dialedin-team commented 10 months ago

Hi @engram-design I encountered the issue even after changing the draggable option from true to false. Therefore, I don't know the exact reason for it.

The problem with the mouse typing cursor in the inner field did not arise in Craft 4.5.6.1; it exclusively occurred in Craft version 4.5.9. Nevertheless, the mouse select issue happened in both versions.

engram-design commented 10 months ago

Changing the draggable option from true to false won't do anything, unless you're re-building all the JS for the field. I'm also not suggesting to do this, as this would render Vizy blocks to be unable to be reordered.

Both mouse issues are related from my testing, and I'm seeing it in Craft 4.5.6.1 and earlier.

engram-design commented 10 months ago

Okay, so after running 4.5.6.1 properly, I can see one issue is fixed and the other isn't, so looks like two separate issues! Looks like this was caused by the tabindex being removed on fields in https://github.com/craftcms/cms/pull/13809

engram-design commented 10 months ago

Fixed for the next release. To get this early, run composer require verbb/vizy:"dev-craft-4 as 2.1.12"

dialedin-team commented 10 months ago

I appreciate your prompt resolution; thank you for the fix @engram-design

engram-design commented 10 months ago

Fixed in 2.1.13