Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setValue function to not ensure unfocus an input field #208

Closed
jdecool opened this issue Apr 17, 2015 · 4 comments
Closed

Allow setValue function to not ensure unfocus an input field #208

jdecool opened this issue Apr 17, 2015 · 4 comments

Comments

@jdecool
Copy link

jdecool commented Apr 17, 2015

I use mink to interact with some javascript managed fields (with select2 jquery plugin for example).

I recently upgrade Behat 2.X to 3.X on a project. But some features are broken because of the setValue function :

 if (in_array($elementName, array('input', 'textarea'))) {
     $existingValueLength = strlen($element->attribute('value'));
     // Add the TAB key to ensure we unfocus the field as browsers are triggering the change event only
     // after leaving the field.
     $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . Key::TAB;
}

I use Mink to open the select field, search for a value and pick up one in the result. But the driver force a tabulation key press and the search is canceled.

Is it possible to change how the function working and allow user to not enforce unfocus when he set a field value ?

I look at the SahiDriver to make a comparison and this behaviour is not consistent with others drivers.

@jdecool
Copy link
Author

jdecool commented Apr 18, 2015

Thanks for your answer. I close this issue PR because of duplication.

@jdecool jdecool closed this as completed Apr 18, 2015
@aik099
Copy link
Member

aik099 commented Apr 18, 2015

@jdecool , if you have any fixing ideas for that problem, then please post in tasks I've mentioned.

@jdecool
Copy link
Author

jdecool commented Apr 18, 2015

Ok. For now I use the work around explain in #188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants