On Thu, 5 Mar 2026 18:02:50 GMT, Dmitry Markov <[email protected]> wrote:

> In `MacCommonDialogs__showFileSaveChooser`, we pre-populate the Save dialog 
> name field using: `setNameFieldStringValue`.
> After that `DialogDispatcher applyExtensions(...)` is invoked. 
> applyExtensions builds the extension filters, selects the default filter and 
> immediately calls `extensionFilterChanged`. That callback reconfigures the 
> `NSSavePanel` allowed types for the selected filter. If the initial filename 
> already contains an extension (e.g. _file.rich_) and the selected filter also 
> enforces that extension (_rich_), the panel effectively appends the extension 
> again resulting in the UI showing _file.rich.rich_. This is especially 
> visible for non-standard extensions like ._rich_.The ._txt_ often appears 
> “normal” because macOS handles known extensions and “hide extension” 
> presentation.
> 
> Fix:
> Always pre-fill the name field with a base name only (no extension) and let 
> the panel/filter selection supply the extension

To other reviewers:

I've added the FileChooser page to the standalone monkey tester
https://github.com/andy-goryachev-oracle/MonkeyTest

-------------

PR Comment: https://git.openjdk.org/jfx/pull/2096#issuecomment-4008334177

Reply via email to