Skip to content

showMessageBox dialog is not highlighting the default button on macOS #40466

@sami-azzam

Description

@sami-azzam

Preflight Checklist

Electron Version

25.2.0

What operating system are you using?

macOS

Operating System Version

macOS Sonoma 14.0

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

No response

Expected Behavior

The default message box button should be highlighted

Actual Behavior

on macOS Sonoma (14.0), the default button isn't highlighted:

image

Here is the code:

const options: MessageBoxOptions = {
      type: "question",
      buttons: ["Delete", "Cancel"],
      defaultId: 1,
      cancelId: 1,
      title: "Confirm Delete",
      message: "Are you sure you would like to delete this item?",
      detail: "This action cannot be undone.",
    };

dialog.showMessageBoxSync(win, options);

@codebytere

Testcase Gist URL

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions