mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-27 06:00:26 +08:00
fix(tabby-terminal): set selected text into search box on opening
This commit is contained in:
parent
9978e0b86f
commit
bb6ed52291
@ -212,6 +212,11 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
||||
this.showSearchPanel = true
|
||||
setImmediate(() => {
|
||||
const input = this.element.nativeElement.querySelector('.search-input')
|
||||
const selectedText = (this.frontend?.getSelection() ?? '').trim()
|
||||
if (input && selectedText.length) {
|
||||
input.value = selectedText
|
||||
}
|
||||
|
||||
input?.focus()
|
||||
input?.select()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user