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

This pull request has now been integrated.

Changeset: 85401e6e
Author:    Dmitry Markov <[email protected]>
Committer: Andy Goryachev <[email protected]>
URL:       
https://git.openjdk.org/jfx/commit/85401e6e4d0885156122f5ee0c937d326ca7ffd2
Stats:     2 lines in 1 file changed: 1 ins; 0 del; 1 mod

8352298: FileChooser: inconsistent behavior with setInitialName()

Reviewed-by: angorya, zelmidaoui

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

PR: https://git.openjdk.org/jfx/pull/2096

Reply via email to