Bug 227215 - Web Inspector: Styles: Autocomplete list should appear when pressing Arrow Down
Summary: Web Inspector: Styles: Autocomplete list should appear when pressing Arrow Down
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-06-21 08:16 PDT by Razvan Caliman
Modified: 2021-06-28 08:17 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Razvan Caliman 2021-06-21 08:16:17 PDT
A common UI pattern is for a hidden list of suggestions for an input field to appear when pressing the Arrow Down key.

In the Styles panel, this is replaced by the keyboard shortcut Ctrl+Space ...:

`/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js:293`

```
        if (this._controlSpaceKeyboardShortcut.matchesEvent(event)) {
            event.stop();
            if (this._suggestionsView.visible)
                this._suggestionsView.hide();
            else {
                const forceCompletions = true;
                this._updateCompletions(forceCompletions);
            }
            return;
        }
```


... likely because it interacts with the behavior of incrementing/decrementing numeric values when holding Arrow Up/Down. See bug 227214.

---

When the typing caret is not overlapping a numeric value, pressing Arrow Down in an editable text field should present the list of completion suggestions if there are any.
Comment 1 Patrick Angle 2021-06-21 08:34:24 PDT
Another thing we need to consider here is multi-line CSS values, where the Up/down arrow keys should have a different meaning. grid-template-areas’ being one that comes to mind. In that case we can’t really provide a completion anyways, but we should make sure we don’t break those cases where you want to move the caret to the next line.
Comment 2 Nikita Vasilyev 2021-06-21 11:37:53 PDT
(In reply to Patrick Angle from comment #1)
> Another thing we need to consider here is multi-line CSS values, where the
> Up/down arrow keys should have a different meaning. grid-template-areas’
> being one that comes to mind. In that case we can’t really provide a
> completion anyways, but we should make sure we don’t break those cases where
> you want to move the caret to the next line.

I was about to make the same example 😂

Even `background` value can span several line, and we do provide completions there. I don't think we should attempt to provide completions in multiline values on ArrowDown.
Comment 3 Radar WebKit Bug Importer 2021-06-28 08:17:16 PDT
<rdar://problem/79864731>