Skip to content

Commit 057211f

Browse files
authored
BC-7631 - Keyboard does not open when tapping on column or board title (#3504)
* Board: fix bug that does not open keyboard, change readonly to disabled * Board-ColumnTitle: * make board menu be a sibling not a child, remove not needed slot, remove negative margins from column title * fix column- & card- touch events on sensitive touch displays * fix cursor for chips in board header * remove not needed touch detection
1 parent 399b7b9 commit 057211f

File tree

6 files changed

+72
-85
lines changed

6 files changed

+72
-85
lines changed

src/modules/feature/board/board/Board.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@
3232
direction: 'horizontal',
3333
disabled: isEditMode || !hasMovePermission,
3434
group: 'columns',
35-
delay: isTouchDetected ? 300 : 0,
35+
delayOnTouchOnly: true,
36+
delay: 300,
37+
touchStartThreshold: 3, // needed for sensitive touch devices
38+
fallbackTolerance: 3, // specifies how far the mouse should move before it's considered a drag
3639
ghostClass: 'sortable-drag-ghost',
3740
easing: 'cubic-bezier(1, 0, 0, 1)',
3841
dragClass: 'sortable-drag-board-card',
@@ -136,7 +139,6 @@ import {
136139
useBoardNotifier,
137140
useSharedEditMode,
138141
} from "@util-board";
139-
import { useTouchDetection } from "@util-device-detection";
140142
import { useDebounceFn } from "@vueuse/core";
141143
import { SortableEvent } from "sortablejs";
142144
import { Sortable } from "sortablejs-vue3";
@@ -191,7 +193,6 @@ watch(
191193
);
192194
193195
useBodyScrolling();
194-
const { isTouchDetected } = useTouchDetection();
195196
196197
const {
197198
hasMovePermission,

src/modules/feature/board/board/BoardColumn.vue

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
@move:column-right="onMoveColumnRight"
1414
@move:column-up="onMoveColumnUp"
1515
@update:title="onUpdateTitle"
16-
:class="{ 'pl-2': !isListBoard }"
1716
/>
1817
<div>
1918
<Sortable
@@ -25,7 +24,10 @@
2524
animation: 250,
2625
bubbleScroll: true,
2726
direction: 'vertical',
28-
delay: isTouchDetected ? 300 : 2,
27+
delayOnTouchOnly: true,
28+
delay: 300,
29+
touchStartThreshold: 3, // needed for sensitive touch devices
30+
fallbackTolerance: 3, // specifies how far the mouse should move before it's considered a drag
2931
disabled: !hasMovePermission,
3032
dragClass: 'elevation-10',
3133
dragoverBubble: false,
@@ -83,10 +85,8 @@ import {
8385
useForceRender,
8486
} from "@data-board";
8587
import { extractDataAttribute, useDragAndDrop } from "@util-board";
86-
import { useTouchDetection } from "@util-device-detection";
8788
import { useDebounceFn } from "@vueuse/core";
8889
import { SortableEvent } from "sortablejs";
89-
9090
import { Sortable } from "sortablejs-vue3";
9191
import { computed, defineComponent, PropType, ref, toRef } from "vue";
9292
import CardHost from "../card/CardHost.vue";
@@ -153,7 +153,6 @@ export default defineComponent({
153153
});
154154
155155
const { isDragging, dragStart, dragEnd } = useDragAndDrop();
156-
const { isTouchDetected } = useTouchDetection();
157156
const showAddButton = computed(
158157
() => hasCreateColumnPermission && isDragging.value === false
159158
);
@@ -317,7 +316,6 @@ export default defineComponent({
317316
hasCreateColumnPermission,
318317
hasMovePermission,
319318
isDragging,
320-
isTouchDetected,
321319
isNotFirstColumn,
322320
isNotLastColumn,
323321
sortableClasses,

src/modules/feature/board/board/BoardColumnHeader.vue

+47-54
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
2-
<BoardColumnInteractionHandler
3-
:isEditMode="isEditMode"
4-
@start-edit-mode="onStartEditMode"
5-
@end-edit-mode="onEndEditMode"
6-
@move:column-keyboard="onMoveColumnKeyboard"
7-
:id="columnId"
8-
>
9-
<div class="column-header mb-4 rounded" ref="columnHeader">
10-
<div class="d-flex align-center py-2 pr-4 pl-2">
2+
<div class="d-flex flex-wrap mb-4 mt-2" ref="columnHeader">
3+
<div class="flex-1-0">
4+
<BoardColumnInteractionHandler
5+
:isEditMode="isEditMode"
6+
@start-edit-mode="onStartEditMode"
7+
@end-edit-mode="onEndEditMode"
8+
@move:column-keyboard="onMoveColumnKeyboard"
9+
:id="columnId"
10+
>
1111
<BoardAnyTitleInput
1212
:value="title.trim()"
1313
:data-testid="`column-title-${index}`"
@@ -18,47 +18,45 @@
1818
:isFocused="isFocusedById"
1919
@update:value="onUpdateTitle"
2020
@blur="onEndEditMode"
21-
>
22-
<BoardMenu
23-
v-if="hasDeletePermission"
24-
:scope="BoardMenuScope.COLUMN"
25-
:data-testid="`column-menu-btn-${index}`"
26-
>
27-
<KebabMenuActionRename
28-
v-if="!isEditMode"
29-
@click="onStartEditMode"
30-
/>
31-
<template v-if="isListBoard">
32-
<KebabMenuActionMoveUp
33-
v-if="isNotFirstColumn"
34-
@click="onMoveColumnUp"
35-
/>
36-
<KebabMenuActionMoveDown
37-
v-if="isNotLastColumn"
38-
@click="onMoveColumnDown"
39-
/>
40-
</template>
41-
<template v-else>
42-
<KebabMenuActionMoveLeft
43-
v-if="isNotFirstColumn"
44-
@click="onMoveColumnLeft"
45-
/>
46-
<KebabMenuActionMoveRight
47-
v-if="isNotLastColumn"
48-
@click="onMoveColumnRight"
49-
/>
50-
</template>
51-
<KebabMenuActionDelete
52-
:name="title"
53-
:scope="BoardMenuScope.COLUMN"
54-
@click="onDelete"
55-
/>
56-
</BoardMenu>
57-
</BoardAnyTitleInput>
58-
</div>
59-
<VDivider aria-hidden="true" class="border-opacity-75" />
21+
/>
22+
</BoardColumnInteractionHandler>
6023
</div>
61-
</BoardColumnInteractionHandler>
24+
<div class="mt-2 mr-3">
25+
<BoardMenu
26+
v-if="hasDeletePermission"
27+
:scope="BoardMenuScope.COLUMN"
28+
:data-testid="`column-menu-btn-${index}`"
29+
>
30+
<KebabMenuActionRename v-if="!isEditMode" @click="onStartEditMode" />
31+
<template v-if="isListBoard">
32+
<KebabMenuActionMoveUp
33+
v-if="isNotFirstColumn"
34+
@click="onMoveColumnUp"
35+
/>
36+
<KebabMenuActionMoveDown
37+
v-if="isNotLastColumn"
38+
@click="onMoveColumnDown"
39+
/>
40+
</template>
41+
<template v-else>
42+
<KebabMenuActionMoveLeft
43+
v-if="isNotFirstColumn"
44+
@click="onMoveColumnLeft"
45+
/>
46+
<KebabMenuActionMoveRight
47+
v-if="isNotLastColumn"
48+
@click="onMoveColumnRight"
49+
/>
50+
</template>
51+
<KebabMenuActionDelete
52+
:name="title"
53+
:scope="BoardMenuScope.COLUMN"
54+
@click="onDelete"
55+
/>
56+
</BoardMenu>
57+
</div>
58+
<VDivider role="presentation" class="flex-1-0-100 border-opacity-75" />
59+
</div>
6260
</template>
6361

6462
<script setup lang="ts">
@@ -152,8 +150,3 @@ const onMoveColumnUp = () => emit("move:column-up");
152150
153151
const onUpdateTitle = (newTitle: string) => emit("update:title", newTitle);
154152
</script>
155-
<style scoped>
156-
.column-header {
157-
align-items: top;
158-
}
159-
</style>

src/modules/feature/board/board/BoardHeader.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ watchEffect(() => {
203203
@import "@/styles/settings.scss";
204204
205205
.v-chip {
206-
cursor: pointer;
206+
cursor: default;
207207
}
208208
209209
.input-width-calc-span {

src/modules/feature/board/card/CardHost.vue

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
@update:value="onUpdateCardTitle($event, cardId)"
3333
:isFocused="isFocusedById"
3434
@enter="onEnter"
35+
class="mx-n4 mb-n2"
3536
/>
3637

3738
<div class="board-menu" :class="boardMenuClasses">

src/modules/feature/board/shared/BoardAnyTitleInput.vue

+15-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<VTextField
33
v-if="scope === 'board'"
4+
class="title-input"
45
hide-details="auto"
56
v-model="modelValue"
67
variant="solo"
@@ -9,7 +10,7 @@
910
:placeholder="placeholderText"
1011
bg-color="transparent"
1112
ref="titleInput"
12-
:readonly="!isEditMode"
13+
:disabled="!isEditMode"
1314
:role="isEditMode ? 'input' : 'heading'"
1415
:aria-level="ariaLevel"
1516
:tabindex="isEditMode ? 0 : -1"
@@ -26,22 +27,18 @@
2627
:rows="1"
2728
auto-grow
2829
flat
29-
class="mx-n4 mb-n2"
30+
class="title-input"
3031
:placeholder="placeholderText"
3132
bg-color="transparent"
3233
ref="titleInput"
33-
:readonly="!isEditMode"
34+
:disabled="!isEditMode"
3435
:role="isEditMode ? 'input' : 'heading'"
3536
:aria-level="ariaLevel"
3637
@keydown.enter="onEnter"
3738
:tabindex="isEditMode ? 0 : -1"
3839
:autofocus="internalIsFocused"
3940
:maxlength="maxLength"
40-
>
41-
<template v-slot:append-inner>
42-
<slot />
43-
</template>
44-
</VTextarea>
41+
/>
4542
</template>
4643

4744
<script lang="ts">
@@ -96,7 +93,7 @@ export default defineComponent({
9693
const titleInput = ref(null);
9794
9895
useInlineEditInteractionHandler(async () => {
99-
setFocusOnEdit();
96+
await setFocusOnEdit();
10097
});
10198
10299
const setFocusOnEdit = async () => {
@@ -209,18 +206,6 @@ export default defineComponent({
209206
overflow: hidden;
210207
}
211208
212-
:deep(textarea[readonly]) {
213-
cursor: pointer;
214-
}
215-
216-
:deep(input[readonly]) {
217-
cursor: pointer;
218-
}
219-
220-
:deep(textarea[readonly])::placeholder {
221-
opacity: 1;
222-
}
223-
224209
:deep(input) {
225210
font-size: var(--heading-3);
226211
background: transparent !important;
@@ -231,4 +216,13 @@ export default defineComponent({
231216
align-items: flex-start;
232217
padding-top: 8px !important;
233218
}
219+
220+
.title-input {
221+
cursor: pointer;
222+
pointer-events: unset !important;
223+
}
224+
225+
.title-input :deep(.v-field--disabled) {
226+
opacity: var(--v-high-emphasis-opacity);
227+
}
234228
</style>

0 commit comments

Comments
 (0)