Skip to content

Commit

Permalink
docs: Fix the textbox.py example h2oai#372
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolapps committed Dec 8, 2022
1 parent 4a9623f commit 4efddaf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py/examples/textbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@app('/demo')
async def serve(q: Q):
if q.args.show_inputs:
if q.args.textbox is not None:
q.page['example'].items = [
ui.text(f'textbox={q.args.textbox}'),
ui.text(f'textbox_disabled={q.args.textbox_disabled}'),
Expand All @@ -22,6 +22,7 @@ async def serve(q: Q):
ui.text(f'textbox_disabled_placeholder={q.args.textbox_disabled_placeholder}'),
ui.text(f'textbox_multiline={q.args.textbox_multiline}'),
ui.text(f'textbox_spellcheck_disabled={q.args.textbox_spellcheck_disabled}'),
ui.text(f'textbox_enter={q.args.textbox_enter}'),
ui.button(name='show_form', label='Back', primary=True),
]
else:
Expand All @@ -40,7 +41,7 @@ async def serve(q: Q):
placeholder='I am disabled'),
ui.textbox(name='textbox_multiline', label='Multiline textarea', multiline=True),
ui.textbox(name='textbox_spellcheck_disabled', label='Spellcheck disabled', spellcheck=False),
ui.textbox(name='textbox_enter', label='Submits the textbox value on Enter key', icon='Search'),
ui.textbox(name='textbox_enter', label='Submit the form when pressing the Enter key', trigger_on_enter=True),
ui.button(name='show_inputs', label='Submit', primary=True),
])
await q.page.save()

0 comments on commit 4efddaf

Please sign in to comment.