Skip to content

windows: File Selection Dialog filter should default select "Custom Files" option #4132

@c-harding

Description

@c-harding

Describe the bug
The file picker in CEF defaults to a single file type, rather than all allowed file types. This is the opposite of the behaviour in Chrome.

Source
Imported from cefsharp/CefSharp#5113

To Reproduce

In Chrome Bootstrap (after upgrading CefSharp to 134.3.90), we're experiencing inconsistencies in how file type filters are displayed in file upload dialogs when using the accept attribute.

In Chrome, multiple file extensions in the accept attribute are combined into a single "Custom Files (.csv,.xlsx)" option, which is the desired behavior.

In CEF, the same accept attribute creates separate filter entries for each file type: "CSV File (.csv)" and "Microsoft Excel Worksheet (.xlsx)", plus an additional "Custom Files" entry.

We are using the Ant Design (antd) Upload component, which internally uses the standard HTML file input with an accept attribute to filter file types. In Chrome, when specifying multiple file types in the accept attribute, they are combined into a single "Custom Files" option in the file selection dialog. However, in CefSharp, the same attribute results in separate file type options being displayed, creating an inconsistent user experience.

The relevant code from our component:

<Upload
    //
    accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/csv"
    //
>
    <Button icon={<UploadOutlined />}>
        //
    </Button>
</Upload>

Expected behavior
One option in the file extension selection:

  • Custom Files (.csv,.xlsx)
Image

Actual behavior
Three options:

  • CSV File (*.csv)
  • Microsoft Excel Worksheet (*.xlsx)
  • Custom Files (.csv,.xlsx)
Image

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: Windows 10
  • CEF Version: 7499

Additional context
The expected behaviour reflects the behaviour in Chrome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions