Fix press Enter clearing text on Google search (#4718)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,7 @@ from skyvern.webeye.actions.actions import (
|
||||
DownloadFileAction,
|
||||
ExtractAction,
|
||||
GotoUrlAction,
|
||||
KeypressAction,
|
||||
ReloadPageAction,
|
||||
TerminateAction,
|
||||
WebAction,
|
||||
@@ -1285,6 +1286,16 @@ class ForgeAgent:
|
||||
"is_retry": step.retry_index > 0,
|
||||
}
|
||||
|
||||
# Tell the handler to skip the auto-completion Tab hack when the
|
||||
# next batched action would be broken by a focus change — e.g. a
|
||||
# KEYPRESS Enter or another action on the same element.
|
||||
if action.action_type == ActionType.INPUT_TEXT and action_idx + 1 < len(action_linked_list):
|
||||
next_action = action_linked_list[action_idx + 1].action
|
||||
if isinstance(next_action, KeypressAction) or (
|
||||
isinstance(next_action, WebAction) and next_action.element_id == action.element_id
|
||||
):
|
||||
action.skip_auto_complete_tab = True
|
||||
|
||||
results = await ActionHandler.handle_action(
|
||||
scraped_page=scraped_page,
|
||||
task=task,
|
||||
|
||||
Reference in New Issue
Block a user