givanz / VvvebJs

Drag and drop page builder library written in vanilla javascript without dependencies or build tools.
https://www.vvveb.com/vvvebjs/editor.html
Apache License 2.0
7.07k stars 1.62k forks source link

Click Event Not Working on Image/Text in Editor #368

Closed eduardokraus closed 1 month ago

eduardokraus commented 1 month ago

While testing the application, I noticed that clicking on the image or text in the specified line does not trigger the expected behavior.

Steps to Reproduce:

  1. Open the editor.html file.
  2. Navigate to image and click Set image.
  3. Select image

Expected Behavior: The click event should trigger the appropriate response.

Actual Behavior: The click event does not trigger any response.

Temporary Fix: I modified the element and it started working as expected:

<button name="button" class="btn btn-primary btn-sm btn-icon mt-2"
        data-target-input="#input-{%=key%}"
        data-target-thumb="#thumb-{%=key%}">
    <i class="la la-image la-lg"
       data-target-input="#input-{%=key%}"
       data-target-thumb="#thumb-{%=key%}"></i>
    <span data-target-input="#input-{%=key%}"
          data-target-thumb="#thumb-{%=key%}">Set image</span>
</button>

Suggested Solution: Investigate why the current implementation is not triggering the click event and consider changing the element as mentioned above or find a more suitable solution.

Additional Information: URL: https://github.com/givanz/VvvebJs/blob/master/editor.html#L1264

Environment:

givanz commented 1 month ago

Thank you for the detailed bug report, it's fixed in the last commit https://github.com/givanz/VvvebJs/commit/469a3c4040b82d7e2f9e0092a2a96c7067d7151e

eduardokraus commented 1 month ago

Thank you