Browse Source

Merge pull request #4576 from nocodb/fix/LTAR-focus

fix(nc-gui): unexpected focus on ListItem
pull/4577/head
Pranav C 2 years ago committed by GitHub
parent
commit
989c568897
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      packages/nc-gui/components/virtual-cell/components/ListItems.vue
  2. 1
      packages/nc-gui/utils/browserUtils.ts

3
packages/nc-gui/components/virtual-cell/components/ListItems.vue

@ -8,6 +8,7 @@ import {
IsPublicInj, IsPublicInj,
computed, computed,
inject, inject,
isDrawerExist,
ref, ref,
useLTARStoreOrThrow, useLTARStoreOrThrow,
useSelectedCellKeyupListener, useSelectedCellKeyupListener,
@ -145,7 +146,7 @@ useSelectedCellKeyupListener(vModel, (e: KeyboardEvent) => {
break break
default: { default: {
const el = filterQueryRef.value?.$el const el = filterQueryRef.value?.$el
if (el) { if (el && !isDrawerExist()) {
filterQueryRef.value.$el.focus() filterQueryRef.value.$el.focus()
} }
} }

1
packages/nc-gui/utils/browserUtils.ts

@ -1,3 +1,4 @@
// refer - https://stackoverflow.com/a/11752084 // refer - https://stackoverflow.com/a/11752084
export const isMac = () => /Mac/i.test(navigator.platform) export const isMac = () => /Mac/i.test(navigator.platform)
export const isDrawerExist = () => document.querySelector('.ant-drawer-open')
export const isDrawerOrModalExist = () => document.querySelector('.ant-modal.active, .ant-drawer-open') export const isDrawerOrModalExist = () => document.querySelector('.ant-modal.active, .ant-drawer-open')

Loading…
Cancel
Save