Skip to content

Commit

Permalink
change focused-id to id
Browse files Browse the repository at this point in the history
  • Loading branch information
muratmerdoglu-dp committed Sep 20, 2024
1 parent 8bcbb4f commit 9d23e8a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 16 deletions.
4 changes: 1 addition & 3 deletions src/modules/data/board/BoardFocusHandler.composable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ const useSharedFocusedId = createSharedComposable(() => {
};

const setElementFocused = (id: MaybeRefOrGetter<FocusableId>) => {
const element = document.querySelector(
`[data-focused-id="${id}"]`
) as HTMLElement;
const element = document.getElementById(id.toString()) as HTMLElement;

element?.focus();
};
Expand Down
2 changes: 0 additions & 2 deletions src/modules/data/board/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { useSocketConnection } from "./socket/socket";
import { useCardStore } from "./Card.store";
import { useBoardInactivity } from "./boardInactivity.composable";
import { useForceRender } from "./fixSamePositionDnD.composable";
import { useSetFocusPrevious } from "./FocusPrevious.composable";

export {
boardActions,
Expand All @@ -23,7 +22,6 @@ export {
useContentElementState,
useEditMode,
useForceRender,
useSetFocusPrevious,
useSharedEditMode,
useSharedBoardPageInformation,
useSocketConnection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :data-focused-id="element.id">
<div :id="element.id">
<RichTextContentElementDisplay
v-if="!isEditMode"
class="rich_text"
Expand Down
2 changes: 1 addition & 1 deletion src/modules/feature/board/board/BoardColumnHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@start-edit-mode="onStartEditMode"
@end-edit-mode="onEndEditMode"
@move:column-keyboard="onMoveColumnKeyboard"
:data-focused-id="columnId"
:id="columnId"
>
<div class="column-header mb-4 rounded" ref="columnHeader">
<div class="d-flex align-center py-2 pr-4 pl-2">
Expand Down
2 changes: 1 addition & 1 deletion src/modules/feature/board/board/BoardHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@end-edit-mode="onEndEditMode"
@keydown.enter="onStartEditMode"
tabindex="0"
:data-focused-id="boardId"
:id="boardId"
>
<div ref="boardHeader">
<BoardAnyTitleInput
Expand Down
1 change: 0 additions & 1 deletion src/modules/feature/board/card/CardHost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
variant="outlined"
tabindex="0"
min-height="120px"
:data-focused-id="card?.id"
:elevation="isEditMode ? 6 : isHovered ? 4 : 2"
:id="cardId"
:ripple="false"
Expand Down
14 changes: 7 additions & 7 deletions src/modules/feature/board/card/ContentElementList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
v-if="isRichTextElementResponse(element)"
:element="element"
:isEditMode="isEditMode"
:data-focused-id="element.id"
:id="element.id"
@move-keyboard:edit="onMoveElementKeyboard(index, element, $event)"
@move-down:edit="onMoveElementDown(index, element)"
@move-up:edit="onMoveElementUp(index, element)"
Expand All @@ -17,7 +17,7 @@
:element="element"
:isEditMode="isEditMode"
:isDetailView="isDetailView"
:data-focused-id="element.id"
:id="element.id"
@move-keyboard:edit="onMoveElementKeyboard(index, element, $event)"
@move-down:edit="onMoveElementDown(index, element)"
@move-up:edit="onMoveElementUp(index, element)"
Expand All @@ -27,7 +27,7 @@
v-else-if="isFileElementResponse(element)"
:element="element"
:isEditMode="isEditMode"
:data-focused-id="element.id"
:id="element.id"
@move-keyboard:edit="onMoveElementKeyboard(index, element, $event)"
@move-down:edit="onMoveElementDown(index, element)"
@move-up:edit="onMoveElementUp(index, element)"
Expand All @@ -37,7 +37,7 @@
v-else-if="showSubmissionContainerElement(element)"
:element="element"
:isEditMode="isEditMode"
:data-focused-id="element.id"
:id="element.id"
@move-keyboard:edit="onMoveElementKeyboard(index, element, $event)"
@move-down:edit="onMoveElementDown(index, element)"
@move-up:edit="onMoveElementUp(index, element)"
Expand All @@ -47,7 +47,7 @@
v-else-if="showExternalToolElement(element)"
:element="element"
:isEditMode="isEditMode"
:data-focused-id="element.id"
:id="element.id"
@move-keyboard:edit="onMoveElementKeyboard(index, element, $event)"
@move-down:edit="onMoveElementDown(index, element)"
@move-up:edit="onMoveElementUp(index, element)"
Expand All @@ -61,7 +61,7 @@
:isFirstElement="firstElementId === element.id"
:isLastElement="lastElementId === element.id"
:hasMultipleElements="hasMultipleElements"
:data-focused-id="element.id"
:id="element.id"
@move-keyboard:edit="onMoveElementKeyboard(index, element, $event)"
@move-down:edit="onMoveElementDown(index, element)"
@move-up:edit="onMoveElementUp(index, element)"
Expand All @@ -74,7 +74,7 @@
:isFirstElement="firstElementId === element.id"
:isLastElement="lastElementId === element.id"
:hasMultipleElements="hasMultipleElements"
:data-focused-id="element.id"
:id="element.id"
@move-keyboard:edit="onMoveElementKeyboard(index, element, $event)"
@move-down:edit="onMoveElementDown(index, element)"
@move-up:edit="onMoveElementUp(index, element)"
Expand Down

0 comments on commit 9d23e8a

Please sign in to comment.