diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue index 55dbb9e020..02ee8353c6 100644 --- a/packages/nc-gui/components/smartsheet/Form.vue +++ b/packages/nc-gui/components/smartsheet/Form.vue @@ -386,6 +386,22 @@ watch(view, (nextView) => { reloadEventHook.trigger() } }) + +function selectAll(event: KeyboardEvent) { + if (event.target instanceof Node) { + if (event.metaKey && event.key === "a") { + const userAgent = navigator.userAgent; + if (/Macintosh/.test(userAgent)) { + window.getSelection()?.selectAllChildren(event.target) + event.preventDefault() + } + } else if (event.ctrlKey && event.key === "a") { + window.getSelection()?.selectAllChildren(event.target) + event.preventDefault() + } + } +} +