Commit 4f71136
committed
fix(webapp): stop Esc in a text field from closing panels
The Esc close shortcuts are registered on `document`, so
`enabledOnInputElements: true` made them fire from every input on the page,
not just fields inside the panel. Typing in a page-level search box or the
chat composer and pressing Esc closed the panel behind it.
The composer and SearchInput tried to guard against this with
`stopPropagation` on the React `onKeyDown`, which cannot work: the app
hydrates into `document`, so React's delegated listener and the hotkey
listener are siblings on the same node and only
`stopImmediatePropagation` would stop the other one.
Drop the flag from the nine Esc close shortcuts instead, so the focused
field handles Esc itself: it clears a search box or leaves the composer with
the draft intact, and a second Esc closes the panel.
Verified in a browser against the seeded References org: Esc from a
page-level search box or a composer with a draft no longer closes the chat
panel, a second Esc does, and Esc still closes dialogs, sheets, detail
panels, and closes only an open dropdown when one is layered over a panel.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 44973d1 commit 4f71136
13 files changed
Lines changed: 19 additions & 15 deletions
File tree
- .server-changes
- apps/webapp/app
- components
- dashboard-agent
- logs
- primitives
- hooks
- routes
- _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index
- _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.batches.$batchParam
- _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam
- _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam
- _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.models._index
- _app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules.$scheduleParam
- resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
847 | | - | |
| 847 | + | |
848 | 848 | | |
849 | 849 | | |
850 | 850 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| |||
0 commit comments