Skip to content

Commit 4186b76

Browse files
authored
fix(pane/#3538): Focus pane on mouse click (#3541)
Fixes #3538
1 parent ac07a70 commit 4186b76

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES_CURRENT.md

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
- #3532 - OSX: Fix crash when opening folder with Unicode characters (fixes #3519)
8686
- #3533 - Completion: Fix hang when detail text is large
8787
- #3537 - Terminal: Fix pasted text showing in reverse order (fixes #3513)
88+
- #3541 - Pane: Shoudl grab focus when clicked (fixes #3538)
8889

8990
### Performance
9091

src/Feature/Pane/Feature_Pane.re

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type command =
1818

1919
[@deriving show({with_path: false})]
2020
type msg('inner) =
21+
| PaneClicked
2122
| TabClicked({index: int})
2223
| CloseButtonClicked
2324
| ToggleMaximizeButtonClicked
@@ -144,6 +145,8 @@ let update = (msg, model) =>
144145
Nothing,
145146
)
146147

148+
| PaneClicked => (model, GrabFocus)
149+
147150
| TabClicked({index}) => ({...model, selected: index}, Nothing)
148151

149152
| Toggle({paneId}) => toggle(~paneId, model)
@@ -462,7 +465,8 @@ module View = {
462465
~isFocused,
463466
~theme,
464467
~height,
465-
)}>
468+
)}
469+
onMouseUp={_ => dispatch(PaneClicked)}>
466470
<View style=Styles.resizer>
467471
<ResizeHandle.Horizontal
468472
onDrag={delta =>

0 commit comments

Comments
 (0)