cockpit-project / cockpit-files

A Featureful File Browser for Cockpit (Modernized and tested version of https://github.com/45Drives/cockpit-navigator)
GNU Lesser General Public License v2.1
27 stars 23 forks source link

Rename has interaction issues (focus on modal open and enter to activate) #622

Closed garrett closed 4 days ago

garrett commented 1 week ago
  1. When you select rename, the focus isn't there. You have to navigate to the field.

https://www.patternfly.org/components/modal/accessibility#focus

"If none of the above apply, place focus on the first focusable element in the modal."

And here's how to hook that up at the PF-React level: https://www.patternfly.org/components/modal/#custom-focus

  1. When you are in the input, hitting the enter key doesn't rename. Sometimes it seems to reload the page, other times it does nothing at all. It feels like the form isn't hooked up properly?

Originally posted by @garrett in https://github.com/cockpit-project/cockpit-files/pull/544#pullrequestreview-2155815216

BTW: The input is not destructive unless you hit enter to rename. When it's in overwrite mode, enter should not rename. This is how it currently works, and is correct. Just specifying that it's important that enter should rename when there isn't a conflict and should not rename when there is a conflict. https://www.patternfly.org/components/modal/#custom-focu