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

test: give time to IE to render elements before testing focus #11275

Merged
merged 1 commit into from
May 19, 2018

Conversation

ncoden
Copy link
Contributor

@ncoden ncoden commented May 16, 2018

Description

Internet Explorer 9/10/11 may not focus the tested element because is is still rendering. To prevent this, we wait after the component initialization.

Note: I tested it a lot and after we .focus() the Dropdown Menu sublink (the sublink exists), IE focus the body instead, as if the sublink could not receive focus. There were no others tests running, all others .focus() in Foundation were disabled. This is a really weird bug and the "not rendered bug" scenario seems the more plausible.

Fixing this IE behavior in components would require to delay the focus for all browsers then trigger a "ready" event. This will be considered for v6.6 because this may introduce a breaking change.

Changes

  • Wait after component are initialized in Dropdown Menu tests, before testing the focus.
  • Add some explanations about this behavior in Dropdown Menu tests

References

Types of changes

  • Documentation
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing
    functionality to change)

Checklist (all required):

  • I have read and follow the CONTRIBUTING document.
  • There are no other pull request similar to this one.
  • The pull request title is descriptive.
  • The template is fully and correctly filled.
  • The pull request targets the right branch (develop or support/*).
  • My commits are correctly titled and contain all relevant information.
  • My code follows the code style of this project.
  • I have updated the documentation accordingly to my changes (if relevant).
  • I have added tests to cover my changes (if relevant).
  • All new and existing tests passed.

For all the following tests testing the currently focused elements,
IE 9/10/11 may not focus the tested element because is is still
rendering. To prevent this, we wait after the component initialization.

Fixing this IE behavior in components would require to delay the focus
for all browsers then trigger a "ready" event.

See https://stackoverflow.com/a/2600261/4317384
See https://stackoverflow.com/a/36032615/4317384
@ncoden
Copy link
Contributor Author

ncoden commented May 18, 2018

poke @DanielRuf

@ncoden ncoden merged commit 645950e into foundation:develop May 19, 2018
ncoden added a commit to ncoden/foundation-sites that referenced this pull request Jun 16, 2018
…test-focus for v6.5.0

1c36420 test: give time to IE to render elements before testing focus

Signed-off-by: Nicolas Coden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants