Closed Bug 2054565 Opened 2 months ago Closed 17 days ago

Forward Delete (⌦) does not work in the macOS Save dialog filename field

Categories

(Core :: Widget: Cocoa, defect)

Firefox 152
defect

Tracking

()

VERIFIED FIXED
156 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox-esr153 --- affected
firefox155 --- wontfix
firefox156 --- verified

People

(Reporter: ari.virtual, Assigned: spohl)

References

Details

(Keywords: regression)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:152.0) Gecko/20100101 Firefox/152.0

Steps to reproduce:

  1. Download any file.
  2. In the native macOS Save dialog displayed by Firefox, click inside the filename field.
  3. Type a few extra characters.
  4. Move the insertion point into the middle of the filename.
  5. Press the Forward Delete (⌦) key.

Actual results:

Nothing happens.

The Edit menu briefly flashes, indicating that Firefox receives the key event, but the filename text field does not process it.

Expected results:

The character to the right of the insertion point should be deleted.

Additional information

The issue appeared immediately after updating to Firefox 152.

The problem is limited to the native macOS Save dialog opened by Firefox.

The following tests were performed:

• Backspace (⌫) works correctly in the Save dialog.
• Forward Delete (⌦) works correctly in Firefox web page text fields.
• Forward Delete (⌦) works correctly in Safari's Save dialog.
• Pressing Fn + Backspace produces the same incorrect behavior as the dedicated Forward Delete key.
• The issue is reproducible every time.

This strongly suggests that the Forward Delete key event is received by Firefox but is not forwarded to the native filename text field in the macOS Save dialog.

Environment
• Firefox 152.0.5 (64-bit)
• macOS Ventura
• Intel Mac
• Apple Aluminum USB Keyboard with Numeric Keypad (A1243)

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Cocoa' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core

This is reproducible for me on macOS 26.6 with attached Apple keyboard. mozregression leads to this regression window

https://hg-edge.mozilla.org/integration/autoland/pushloghtml?fromchange=5298810a8b2921dac323b4ce5fd0e8ed88b82cdb&tochange=8a7248901e14330effcc242be538b90f03577772

Bug 2040851: Don't mirror XUL command disabled state to NSMenuItem for standard Edit menu items on macOS
Bug 2040844: Override undo:/redo: on ChildView to restore Edit menu icons and Gecko menu-click dispatch on macOS

Severity: -- → S3
Flags: needinfo?(spohl.mozilla.bugs)
Keywords: regression
See Also: → 2040851
See Also: → 2040844

Could you see if your issue is fixed in the following build?

  1. Download this try build, which contains a potential fix:

https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/Kj1DTfXNSqiDSac0Lmzqkg/runs/0/artifacts/public/build/target.tar.gz

  1. Extract it in ~/Downloads and clear the quarantine flag on the extracted app:
xattr -dr com.apple.quarantine ~/Downloads/Firefox\ Nightly.app
  1. Launch "Firefox Nightly" from ~/Downloads and download any file to bring up the Save dialog.
  2. Click in the filename field, move the insertion point into the middle of the name, and press the forward delete key. Fn+Backspace should behave the same way.
  3. In the same field, please also check that Command+C, Command+V, Command+X, Command+Z and Command+A still work.

This is a try build rather than a Nightly build, so it will not update itself and is only meant for this check. It uses its own profile, separate from the Firefox you normally run. If you would rather pick a profile yourself, you can start it with:

~/Downloads/Firefox\ Nightly.app/Contents/MacOS/firefox -ProfileManager
Flags: needinfo?(spohl.mozilla.bugs)
Flags: needinfo?(fryguy9)
Flags: needinfo?(ari.virtual)
See Also: → 2060306
Status: UNCONFIRMED → NEW
Ever confirmed: true

I can reproduce on short keyboards using Fn+Backspace (the key combo for forward delete) as well.

The key gets consumed in "Edit" menu by the "Delete" option item (showing it as its shortcut key), which — surprisingly — only works on selections, but doesn't do forward–delete just right of the caret. So it works when bits of text are selected, but does empty "delete" (i.e. similar to "cut") when there's no selection, just a blinking caret.

Attached video v155-firefoxci-try.mov

Tried the attached build on MBA13 (15.7.8) using the built–in keyboard and Fn modifier (equally affected as shown earlier) and the linked CI artifact Nightly seems to work great, thanks!

The Fn+⌫ combo no longer visibly invokes the system menu (meaning a shortcut hit), and both the backspace and delete functionality work, no matter if text is selected or not. Also any previous cut+paste functionality is unaffected.

The Edit > Delete menu item carries the forward delete key as its shortcut, with no modifiers, because it is wired to the XUL key element with keycode="VK_DELETE". Since bug 2036608 the item's action is delete: with no target, so it travels the macOS responder chain, and since bug 2040851 the item is always enabled. While a native window such as an NSSavePanel sheet has focus, AppKit therefore matches the forward delete key against our menu item and performs delete: instead of leaving the keystroke alone. The panel's filename field reads delete: as "delete the current selection", so with a collapsed caret nothing happens at all and the keystroke is spent.

Native text fields read keys that arrive without a Command modifier as plain editing or navigation keys, so leave those keys to the window that has focus. Shortcuts that include Command are still handled here, which is what lets native fields respond to Command+C/V/X/Z/A.

Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED

Redirect a needinfo that is pending on an inactive user to the triage owner.
:spohl.mozilla.bugs, since the bug has recent activity, could you please find another way to get the information or close the bug as INCOMPLETE if it is not actionable?

For more information, please visit BugBot documentation.

Flags: needinfo?(ari.virtual) → needinfo?(spohl.mozilla.bugs)

Hi

Thank you for investigating and working on this issue.

I’m sorry for not replying sooner.

I can confirm that the problem is still present in Firefox 154.0 on macOS Ventura 13.7.8 on my system. The Forward Delete key (⌦), as well as Fn+Backspace, still does not delete the character to the right of the cursor in the native macOS Save dialog.

I’m glad to see that the cause has been identified and that a fix has been tested successfully. I hope the fix will make it into an upcoming Firefox release.

Please let me know if you need any additional information or testing from me.

Flags: needinfo?(spohl.mozilla.bugs)
Flags: needinfo?(fryguy9)
Pushed by spohl@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1dc10ba9f298 https://hg.mozilla.org/integration/autoland/rev/f3cd87e96051 Leave keystrokes that carry no Command modifier to native windows that have focus on macOS. r=mac-reviewers,mstange
Blocks: 2060306
See Also: 2060306
Status: ASSIGNED → RESOLVED
Closed: 17 days ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
QA Whiteboard: [qa-ver-opt-c157/b156]
Duplicate of this bug: 2068489
QA Contact: tzsoldos

I've reproduced this issue using Firefox 154.0a1 (2026.07.13) following the STR from description on macOS 12.
Verified as fixed on the latest Nightly 157.0a1 (2026.09.08) and on Firefox 156.0b4, using macOS 12 and macOS13 where the issue no longer persists, now the Fn+Backspace keyboard combination and Backspace key, both works as expected in the native macOS Save dialog displayed by Firefox.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-ver-opt-c157/b156] → [qa-ver-done-c157/b156]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: