Skip to content

Error with ui.keyboard when autocomplete on input. #4290

Closed
@natankeddem

Description

Description

Hello,
I think this is the same error reported here but can't be certain:
#2545
When utilizing autocomplete with ui.input and concurrently having a ui.keyboard event tracker active an error is thrown:

Traceback (most recent call last):
  File "C:\test\venv\Lib\site-packages\nicegui\events.py", line 430, in handle_event
    result = cast(Callable[[EventT], Any], handler)(arguments)
  File "C:\test\venv\Lib\site-packages\nicegui\elements\keyboard.py", line 78, in _handle_key
    repeat=e.args['repeat'],
           ~~~~~~^^^^^^^^^^
KeyError: 'repeat'

My test code:

from nicegui import ui

ui.keyboard(ignore=[])
ui.input("email").props('autocomplete="email"')
if __name__ in {"__main__", "__mp_main__"}:
    ui.run(port=8080, show=False, reload=False)

To trigger the error just select from an email on the autocomplete list. It appears that the autofill only provides e.args with a value of {'action': 'keyup'} and so only action and no other keys.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions