Skip to content

Commit 4efddaf

Browse files
committed
docs: Fix the textbox.py example h2oai#372
1 parent 4a9623f commit 4efddaf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

py/examples/textbox.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@app('/demo')
99
async def serve(q: Q):
10-
if q.args.show_inputs:
10+
if q.args.textbox is not None:
1111
q.page['example'].items = [
1212
ui.text(f'textbox={q.args.textbox}'),
1313
ui.text(f'textbox_disabled={q.args.textbox_disabled}'),
@@ -22,6 +22,7 @@ async def serve(q: Q):
2222
ui.text(f'textbox_disabled_placeholder={q.args.textbox_disabled_placeholder}'),
2323
ui.text(f'textbox_multiline={q.args.textbox_multiline}'),
2424
ui.text(f'textbox_spellcheck_disabled={q.args.textbox_spellcheck_disabled}'),
25+
ui.text(f'textbox_enter={q.args.textbox_enter}'),
2526
ui.button(name='show_form', label='Back', primary=True),
2627
]
2728
else:
@@ -40,7 +41,7 @@ async def serve(q: Q):
4041
placeholder='I am disabled'),
4142
ui.textbox(name='textbox_multiline', label='Multiline textarea', multiline=True),
4243
ui.textbox(name='textbox_spellcheck_disabled', label='Spellcheck disabled', spellcheck=False),
43-
ui.textbox(name='textbox_enter', label='Submits the textbox value on Enter key', icon='Search'),
44+
ui.textbox(name='textbox_enter', label='Submit the form when pressing the Enter key', trigger_on_enter=True),
4445
ui.button(name='show_inputs', label='Submit', primary=True),
4546
])
4647
await q.page.save()

0 commit comments

Comments
 (0)