mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-06 16:39:08 +01:00
Merge pull request #82485 from skprabhanjan/fix-82200
Fix #82200 - "Preserve Case" button in search viewlet is not tabbable
This commit is contained in:
2 files changed
+15
-1
No files matched your search
@@ -245,7 +245,7 @@ export class SearchView extends ViewletPanel {
|
||||
if (this.searchWidget.isReplaceActive()) {
|
||||
this.searchWidget.focusReplaceAllAction();
|
||||
} else {
|
||||
this.searchWidget.focusRegexAction();
|
||||
this.searchWidget.isReplaceShown() ? this.searchWidget.replaceInput.focusOnPreserve() : this.searchWidget.focusRegexAction();
|
||||
}
|
||||
dom.EventHelper.stop(e);
|
||||
}
|
||||
|
||||
@@ -389,6 +389,7 @@ export class SearchWidget extends Widget {
|
||||
this.replaceInputFocusTracker = this._register(dom.trackFocus(this.replaceInput.inputBox.inputElement));
|
||||
this._register(this.replaceInputFocusTracker.onDidFocus(() => this.replaceInputBoxFocused.set(true)));
|
||||
this._register(this.replaceInputFocusTracker.onDidBlur(() => this.replaceInputBoxFocused.set(false)));
|
||||
this._register(this.replaceInput.onPreserveCaseKeyDown((keyboardEvent: IKeyboardEvent) => this.onPreserveCaseKeyDown(keyboardEvent)));
|
||||
}
|
||||
|
||||
triggerReplaceAll(): Promise<any> {
|
||||
@@ -495,6 +496,15 @@ export class SearchWidget extends Widget {
|
||||
}
|
||||
|
||||
private onRegexKeyDown(keyboardEvent: IKeyboardEvent) {
|
||||
if (keyboardEvent.equals(KeyCode.Tab)) {
|
||||
if (this.isReplaceShown()) {
|
||||
this.replaceInput.focusOnPreserve();
|
||||
keyboardEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private onPreserveCaseKeyDown(keyboardEvent: IKeyboardEvent) {
|
||||
if (keyboardEvent.equals(KeyCode.Tab)) {
|
||||
if (this.isReplaceActive()) {
|
||||
this.focusReplaceAllAction();
|
||||
@@ -503,6 +513,10 @@ export class SearchWidget extends Widget {
|
||||
}
|
||||
keyboardEvent.preventDefault();
|
||||
}
|
||||
else if (KeyMod.Shift | KeyCode.Tab) {
|
||||
this.focusRegexAction();
|
||||
keyboardEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
private onReplaceInputKeyDown(keyboardEvent: IKeyboardEvent) {
|
||||
|
||||
Reference in new issue
Block a user