Skip to content

FileUpload 'chooseOptions' triggers file dialog on double-click in icon type "string class name" #7886

@NADIRATIF

Description

@NADIRATIF

FileUpload 'chooseOptions' triggers file dialog on double-click in icon type "string class name"

Component: FileUpload

Current Behavior:

The file selection dialog/window only opens consistently after a double-click on the "Choose" button when the chooseOptions attribute is used (specifically when an icon is the primary or sole visual element of the button in basic/advenced mode).

CodeSandbox Link (Recommended): check the example of template in the primereact documentation

https://primereact.org/fileupload/#template

Additional Information:

  • This behavior seems to be specific to the FileUpload component when chooseOptions is utilized icon as a string.

Reproducer

https://primereact.org/fileupload/#template

System Information

PrimeReact Version:10.9.4
React Version: 18.3.1
Browser: Chrome
Operating System: macOS

Steps to reproduce the behavior

Reproduction Steps:

  1. Use the <FileUpload> component in mode="basic"/mode="advanced".
  2. Configure the chooseOptions attribute with at least the icon property (e.g., chooseOptions={{ icon: 'pi pi-fw pi-plus' }}). Other properties within chooseOptions might also trigger this.
  3. In a browser environment, single-click the "Choose" button (which will only display the icon in this configuration).
  4. Observe that the file selection dialog/window does not appear.
  5. Double-click the same "Choose" button.
  6. Observe that the file selection dialog/window does appear.

Expected behavior

Expected Behavior:

The file selection dialog/window should open on a single-click of the "Choose" button, regardless of the configuration of the chooseOptions attribute, as this is the standard behavior for file input triggers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions