Can we set focus on "clear data" button when "Clear browsing data" dialog is invoked?

Description of the issue:
“Clear data” button does not have focus when I enter “Clear browsing data” window via Cmd+Shift+Delete

Steps to Reproduce (add as many as necessary):

  1. Launch Brave
  2. Visit any website, then press CTRL + T (or CMD + T) to open a new tab, visit another website
  3. Click Cmd+Shift+Delete, select Advanced window
  4. Click Cancel
  5. Click Cmd+Shift+Delete
  6. Press ENTER

Actual Result (gifs and screenshots are welcome!):
Nothing happens.

Expected Result:
I expect the “Clear data” button to be triggered from hitting ENTER, since it should have initial focus upon rendering of that dialog.

Reproduces how often:
Always

Brave Version(See the About Brave page in the main menu):
Version 1.31.88 Chromium: 95.0.4638.69 (Official Build) (x86_64)

Reproducible on current live release (yes/no):
Yes

Additional information:
I’m using macOS Big Sur 11.6.1

1 Like

I dunno… just speaking for myself, I would rather NOT have a ‘destructive’ action be the default behind an Enter or Spacebar press.

If there could be a very distinct accelerator combination for it though, I think that would make sense. Just not Enter or Space, and JMHO.

1 Like

Most browsers I have tried allow pressing ENTER or SPACE to trigger that button or its equivalent (Chrome, Opera, Safari, Firefox, etc.)

With that said, I honestly do not believe it matters if it is ENTER, SPACE or some other key combination. I should able to trigger the “clearing” of data with the keyboard alone (no mouse, and without the ability to see the screen at times (want to clear history and close the browser, I should be able to do: Cmd-Shift-Del, then ENTER (or similar), then Cmd-Q). Brave is the only browser where I cannot find a way to do this.

1 Like

Here’s something that works on Windows; might be different keys on macOS, but you might be able to find the equivalent.

Ctrl+Shift+Del to get the dialogue to open (as you’re already doing).

Then, Shift+Tab several times, probably 3-5x (see below), until ‘Clear data’ is selected; then press Space or Enter. Basically you’re just reverse-cycling thru the buttons and controls until the selection comes back thru the bottom of the dialogue.

I tried in 2 different profiles, for some reason one of them took 4 keystrokes, the other 3. Not sure why but maybe something to do with extensions or some other difference in configuration. I didn’t spend any time on figuring out why they’re different, but within a profile I would expect it to be consistent.

I tried that, it works, but still, it’s not the same as a deterministic set of keyboard steps enjoyed by users of alternative browsers.

One still need to look at the screen, and then figure out what the number of tabbing needed. Harder to train muscle memory for this.

Do you happen to know where on GitHub that dialog is? I tried https://github.com/brave/brave-core/search?q=IDS_SETTINGS_CLEAR_DATA but could not find where this identifier is being used. I may be missing something obvious, but it’s my first time looking at this repo.

UPDATE: just found this: https://github.com/brave/brave-core/tree/09fb27c81bec1d0c77c5c1dcde857e67355d4903/browser/resources/settings/brave_clear_browsing_data_dialog