Skip to content

Commit 8633d16

Browse files
author
maebahesioru
committed
fix: use fill() instead of type() for spinbutton parameters
type() simulates keystrokes which causes decimal point to be ignored in number inputs (e.g. '1.0' -> '10' -> clamped to max '2'). fill() sets value directly, avoiding this issue.
1 parent cdcb5a0 commit 8633d16

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/browser/page_controller.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -608,17 +608,17 @@ def extract_float(s):
608608
strategy_name = "Ctrl+A Fill"
609609
await locator.click()
610610
await locator.press('Control+a')
611-
await locator.type(str(target_value), delay=30)
611+
await locator.fill(str(target_value))
612+
await locator.dispatch_event('input')
613+
await locator.dispatch_event('change')
612614
await locator.press('Tab')
613615
await asyncio.sleep(DELAY_AFTER_FILL)
614-
await locator.dispatch_event('change')
615616
else:
616-
strategy_name = "Select & Type"
617-
await locator.focus()
618-
await locator.press('Control+a')
619-
await locator.press('Backspace')
620-
await asyncio.sleep(SLEEP_TICK)
621-
await locator.type(str(target_value), delay=50)
617+
strategy_name = "Triple Click Fill"
618+
await locator.click(click_count=3)
619+
await locator.fill(str(target_value))
620+
await locator.dispatch_event('input')
621+
await locator.dispatch_event('change')
622622
await locator.press('Tab')
623623

624624
await asyncio.sleep(SLEEP_LONG)

0 commit comments

Comments
 (0)