Skip to content

Checkboxradio (e.g. resize dialog tabs) not working properly when elFinder is inside <form> element #3684

@blutorange

Description

@blutorange

Describe the bug

The image resize dialog uses jQueryUI's checkboxradio widget for the selection between resize, crop, rotate.

When elFinder is inside a <form> element, switching between these tabs works, but the UI is not updated properly: the selected tab does not get highlighted.

Taking a look at the DOM, you can see that the ui-state-active class does not get removed from the non-active elements when switching between tabs.

Cause

The technical cause of this bug is that JQueryUI only checks for a containing form upon initialization of the widget, but elFinder initializes the checkboxradio before the element was added to the DOM. In detail:

Suggested solution

Initialize the checkboxradio widget only once the element was added to the DOM. This way, JQueryUI can find the form, resolving the bug.

To Reproduce

Steps to reproduce the behavior:

  1. Ensure that elFinder is inside a <form> element
  2. Go to a folder with an editable image
  3. Right click -> resize & rotate
  4. Switch between resize, crop, rotate
  5. Non-active tabs are displayed as active

You can also reproduce this on the official showcase https://studio-42.github.io/elFinder/ by wrapping elFinder in a form via $("#elfinder").wrap("<form>") and then opening the resize dialog:

Screencast.from.2024-12-02.11-59-57.webm

Expected behavior

Only the active tab is displayed as active.

Desktop (please complete the following information):

  • OS: Linux xm-awa-mobil 6.8.0-35-generic #35-Ubuntu x86_64 x86_64 x86_64 GNU/Linux
  • Browser Version 131.0.6778.85 (Official Build) (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions