Skip to content

Commit

Permalink
BC-8160 - Fix titles in board in edit mode (#3517)
Browse files Browse the repository at this point in the history
* Adjust cursor management in BoardAnyTitleInput component to be set at the end of the input
  • Loading branch information
wolfganggreschus authored Jan 27, 2025
1 parent 320eadb commit 3e21f5a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/modules/feature/board/shared/BoardAnyTitleInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
:maxlength="maxLength"
@keydown.enter="onEnter"
/>

<VTextarea
v-else
hide-details="auto"
Expand Down Expand Up @@ -99,9 +100,9 @@ export default defineComponent({
const setFocusOnEdit = async () => {
await nextTick();
internalIsFocused.value = true;
if (titleInput.value) {
(titleInput.value as VTextarea).focus();
cursorToEnd();
}
};
Expand Down Expand Up @@ -180,6 +181,13 @@ export default defineComponent({
return "";
});
const cursorToEnd = () => {
if (titleInput.value) {
const length = (titleInput.value as VTextarea).value.length;
(titleInput.value as VTextarea).setSelectionRange(length, length);
}
};
return {
ariaLevel,
modelValue,
Expand All @@ -188,6 +196,7 @@ export default defineComponent({
internalIsFocused,
titleInput,
placeholderText,
cursorToEnd,
};
},
});
Expand Down

0 comments on commit 3e21f5a

Please sign in to comment.