From 47f34ee7851bf0191379755bef4ec8c72644da37 Mon Sep 17 00:00:00 2001 From: nith2001 Date: Wed, 26 Apr 2023 16:33:50 -0700 Subject: [PATCH] Enabled wrapping for Form Title Wrapping enabled for title while preserving SelectAll capability. Moving on to fixing the title placeholder so that it has a gray placeholder that can be replaced with black input text. --- .../nc-gui/components/smartsheet/Form.vue | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) 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() + } + } +} +