mirror of
https://github.com/harness/drone.git
synced 2025-05-10 22:21:22 +08:00
Make hotkey more seamless (#579)
This commit is contained in:
parent
4f21c1b096
commit
dd37e1027a
@ -56,7 +56,7 @@ export const SearchInputWithSpinner: React.FC<SearchInputWithSpinnerProps> = ({
|
||||
placeholder={placeholder || getString('search')}
|
||||
leftIcon={icon as IconName}
|
||||
style={{ width, height }}
|
||||
autoFocus
|
||||
autoFocus={!readOnly && !disabled}
|
||||
onFocus={event => event.target.select()}
|
||||
onInput={event => {
|
||||
setQuery(event.currentTarget.value || '')
|
||||
|
@ -63,7 +63,15 @@ export function ContentHeader({
|
||||
}
|
||||
}, [performSearch, search, searchSampleQueryIndex])
|
||||
|
||||
useHotkeys('ctrl+k', () => setShowSearchModal(true))
|
||||
useHotkeys(
|
||||
'ctrl+k',
|
||||
() => {
|
||||
if (!showSearchModal) {
|
||||
setShowSearchModal(true)
|
||||
}
|
||||
},
|
||||
[showSearchModal]
|
||||
)
|
||||
|
||||
const permPushResult = hooks?.usePermissionTranslate?.(
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user