Merge pull request #966 from omnivore-app/fix/add-note-form

Put the Add Note form in a form element so submit works
This commit is contained in:
Jackson Harper 2022-07-14 18:04:38 -07:00 committed by GitHub
commit f85b037d93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,26 +82,34 @@ export function HighlightNoteModal(
event.preventDefault()
}}
>
<VStack>
<ModalTitleBar title="Notes" onOpenChange={props.onOpenChange} />
<StyledTextArea
css={{
mt: '16px',
p: '6px',
width: '100%',
height: '248px',
fontSize: '14px',
border: '1px solid $textNonessential',
borderRadius: '6px'
}}
autoFocus
placeholder={'Add your note here'}
value={noteContent}
onChange={handleNoteContentChange}
maxLength={4000}
/>
<ModalButtonBar onOpenChange={props.onOpenChange} acceptButtonLabel="Save" />
</VStack>
<form
onSubmit={(event) => {
event.preventDefault()
saveNoteChanges()
props.onOpenChange(false)
}}
>
<VStack>
<ModalTitleBar title="Notes" onOpenChange={props.onOpenChange} />
<StyledTextArea
css={{
mt: '16px',
p: '6px',
width: '100%',
height: '248px',
fontSize: '14px',
border: '1px solid $textNonessential',
borderRadius: '6px'
}}
autoFocus
placeholder={'Add your note here'}
value={noteContent}
onChange={handleNoteContentChange}
maxLength={4000}
/>
<ModalButtonBar onOpenChange={props.onOpenChange} acceptButtonLabel="Save" />
</VStack>
</form>
</ModalContent>
</ModalRoot>
)