focus task name on modal open
This commit is contained in:
Vendored
+560
-632
File diff suppressed because it is too large
Load Diff
Vendored
+6086
-8069
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@ import { SearchModal } from "../Modals/searchModal";
|
|||||||
import { TaskSettingsModal } from "../Modals/taskSettingsModal";
|
import { TaskSettingsModal } from "../Modals/taskSettingsModal";
|
||||||
import { TaskViewModelToEntry } from "../Components/taskEntry";
|
import { TaskViewModelToEntry } from "../Components/taskEntry";
|
||||||
import { translations } from "../translations";
|
import { translations } from "../translations";
|
||||||
|
import { setFocusWithDelay } from "../utility";
|
||||||
|
|
||||||
export function BoardPage(boardViewModel: BoardViewModel) {
|
export function BoardPage(boardViewModel: BoardViewModel) {
|
||||||
boardViewModel.loadData();
|
boardViewModel.loadData();
|
||||||
@@ -49,6 +50,8 @@ export function BoardPage(boardViewModel: BoardViewModel) {
|
|||||||
if (boardViewModel.selectedTaskViewModel.value == undefined) {
|
if (boardViewModel.selectedTaskViewModel.value == undefined) {
|
||||||
return <div></div>;
|
return <div></div>;
|
||||||
} else {
|
} else {
|
||||||
|
setFocusWithDelay();
|
||||||
|
|
||||||
return TaskSettingsModal(
|
return TaskSettingsModal(
|
||||||
boardViewModel.selectedTaskViewModel.value,
|
boardViewModel.selectedTaskViewModel.value,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { MonthGrid } from "../Components/monthGrid";
|
|||||||
import { TaskSettingsModal } from "../Modals/taskSettingsModal";
|
import { TaskSettingsModal } from "../Modals/taskSettingsModal";
|
||||||
import { TaskViewModelToEntry } from "../Components/taskEntry";
|
import { TaskViewModelToEntry } from "../Components/taskEntry";
|
||||||
import { translations } from "../translations";
|
import { translations } from "../translations";
|
||||||
|
import { setFocusWithDelay } from "../utility";
|
||||||
|
|
||||||
export function CalendarPage(calendarPageViewModel: CalendarPageViewModel) {
|
export function CalendarPage(calendarPageViewModel: CalendarPageViewModel) {
|
||||||
calendarPageViewModel.loadData();
|
calendarPageViewModel.loadData();
|
||||||
@@ -95,6 +96,8 @@ export function CalendarPage(calendarPageViewModel: CalendarPageViewModel) {
|
|||||||
) {
|
) {
|
||||||
return <div></div>;
|
return <div></div>;
|
||||||
} else {
|
} else {
|
||||||
|
setFocusWithDelay();
|
||||||
|
|
||||||
return TaskSettingsModal(
|
return TaskSettingsModal(
|
||||||
calendarPageViewModel.selectedTaskViewModel.value,
|
calendarPageViewModel.selectedTaskViewModel.value,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export function TaskSettingsModal(taskViewModel: TaskViewModel) {
|
|||||||
<span>
|
<span>
|
||||||
{translations.chatPage.task.taskNameLabel}
|
{translations.chatPage.task.taskNameLabel}
|
||||||
</span>
|
</span>
|
||||||
<input bind:value={taskViewModel.name}></input>
|
<input bind:value={taskViewModel.name} id="focused"></input>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
|||||||
@@ -9,3 +9,11 @@ export function allowDrag(event: DragEvent) {
|
|||||||
export function reload() {
|
export function reload() {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setFocus() {
|
||||||
|
document.getElementById("focused")?.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setFocusWithDelay() {
|
||||||
|
setTimeout(setFocus, 100);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user