Avoid accidental auto-submit of new msg form, for subject field

This commit is contained in:
Lance Edgar 2023-03-23 10:23:19 -05:00
parent 9125d7ef74
commit 714c0a6cfd
3 changed files with 19 additions and 3 deletions

View file

@ -221,11 +221,13 @@ class MessageView(MasterView):
if self.creating:
f.set_widget('subject', dfwidget.TextInputWidget(
placeholder="please enter a subject",
autocomplete='off'))
autocomplete='off',
attributes={'@keydown.native': 'subjectKeydown'}))
f.set_required('subject')
# body
f.set_widget('body', dfwidget.TextAreaWidget(cols=50, rows=15))
f.set_widget('body', dfwidget.TextAreaWidget(
cols=50, rows=15, attributes={'ref': 'messageBody'}))
if self.creating:
f.remove('sender', 'sent')