Skip to content

Commit

Permalink
Merge pull request #361 from anvilistas/chips-andriod
Browse files Browse the repository at this point in the history
chips input - android devices
  • Loading branch information
meatballs authored Jul 6, 2022
2 parents 09a2fa7 + d2b2599 commit 6500f9f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client_code/ChipsInput/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from anvil import HtmlPanel as _HtmlPanel
from anvil.js import get_dom_node as _get_dom_node
from anvil.js.window import navigator

from ..Chip import Chip
from ..utils._component_helpers import _get_color, _html_injector, _spacing_property
Expand Down Expand Up @@ -48,6 +49,9 @@
}


is_android = "Android" in navigator.userAgent


class ChipsInput(ChipsInputTemplate):
def __init__(self, **properties):
self._chips = []
Expand Down Expand Up @@ -174,6 +178,11 @@ def _chip_input_key_down(self, js_event):
self._reset_deleting(False)
if js_event.key == "Tab":
js_event.preventDefault()

elif is_android and js_event.key == "Tab":
js_event.preventDefault()
self._chip_input_pressed_enter()

except IndexError:
pass

Expand Down

0 comments on commit 6500f9f

Please sign in to comment.