Skip to content

Commit

Permalink
Set wheel event handler to handle Input[type=number] on Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Jan 19, 2024
1 parent 45f8020 commit 46a248a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/pizza.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ def order(event):
ltk.Heading1("Dave's Pizza Place"),

ltk.HBox(ltk.Label("Date:"), ltk.DatePicker()),

ltk.Break(),
ltk.VBox(
ltk.Label("Number of Pizzas:"),
ltk.Input(1).attr("type", "number")
),

ltk.Break(),
ltk.HBox(
Expand Down
1 change: 1 addition & 0 deletions ltk/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ class Input(Widget):
def __init__(self, value, style=DEFAULT_CSS):
Widget.__init__(self, style)
self.element.val(value)
self.on("wheel", lambda event: None) # ensure Chrome handles wheel events


class Checkbox(Widget):
Expand Down

0 comments on commit 46a248a

Please sign in to comment.