Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

SafariDriver does not fire change event when focus is lost on form field. #4061

Open
lukeis opened this issue Mar 3, 2016 · 5 comments
Open

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 4061

In Safari, if you focus on a text input element (using JS), change its value, then focus
on another element, the "change" event is not fired.  Since the bot.action.type atom
leaves focus in the element, the change event would not fire on sendKey. The change
should fire on a subsequent command when focus is changed.

Safari does not detect the changed value (since it was done via JS), so it will not
automatically fire the change event. This means we'll need to track focus in the driver
and manually fire the change event where appropriate.

This causes the following test to fail:
JavascriptEnabledDriverTest#testChangeEventIsFiredAppropriatelyWhenFocusIsLost

Reported by jmleyba on 2012-06-11 03:43:53

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Can anyone suggest a workaround for this  If (any)?

Reported by pankaj.arora.06 on 2012-07-03 15:40:13

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

On comment #1, I believe the bug description specifies the workaround. You just need
to manually fire/execute the onChange event for the specified element via executing
the proper javascript. It means you'd need to know what is the proper javascript code
to execute for onChange event against given element. Your website/app developers can
probably help out with that.

Reported by mangaroo on 2012-07-03 20:41:55

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

This issue was updated by revision r17356.

Suppressing JavascriptEnabledDriverTest#testChangeEventIsFiredAppropriatelyWhenFocusIsLost
until bug is fixed.

Reported by jmleyba on 2012-07-07 04:18:50

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Bumping this. Has this issue been fixed? I can't get safari to trigger the change event
after leaving focus on the input. 

Reported by Preston90 on 2014-10-28 19:52:41

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 17:44:49

  • Labels added: Restrict-AddIssueComment-Commit

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant