Skip to content

Commit

Permalink
fix: Playモードでフォーカスしないように
Browse files Browse the repository at this point in the history
  • Loading branch information
nakasyou committed Apr 24, 2024
1 parent 364e2ad commit 08e7777
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/islands/note/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Notes from './components/Notes'
import { createTextNote } from './components/notes/TextNote'
import Header from './components/Header'
import Fab from './components/Fab'
import { Show, createSignal, onMount, onCleanup } from 'solid-js'
import { Show, createSignal, onMount, onCleanup, createEffect } from 'solid-js'

import './App.css'
import { createImageNote } from './components/notes/ImageNote'
Expand Down Expand Up @@ -67,6 +67,18 @@ export default (props: Props) => {
saveStep()
})
const [getLoadError, setLoadError] = createSignal<string>()

createEffect(() => {
if (!noteBookState.isEditMode) {
for (const note of notes.notes()) {
for (const handler of (note.events?.focus ?? [])) {
handler({
isActive: false
})
}
}
}
})
return <div class="bg-background h-[100dvh] touch-manipulation">
<Show when={getLoadError()}>
<Dialog onClose={() => setLoadError(void 0)} type="alert" title="Load Error">{ getLoadError() }</Dialog>
Expand Down

0 comments on commit 08e7777

Please sign in to comment.