Repository navigation
Loading the syn.js library causes Firefox to change the page position - #30
andrewnicols wants to merge 1 commit into
Conversation
|
So rather than removing the focus, I opted to restore the original focus, and the document scroll position. |
It fixes it's repositioning problem, has to do with the scroll and focus() bitovi/syn#30
It fixes it's repositioning problem, has to do with the scroll and focus() bitovi/syn#30
It fixes it's repositioning problem, has to do with the scroll and focus() bitovi/syn#30
It fixes it's repositioning problem, has to do with the scroll and focus() bitovi/syn#30
It fixes it's repositioning problem, has to do with the scroll and focus() bitovi/syn#30
|
Is it possible to add a test for this to see more clearly what is happening? Can't tell from your description. |
|
I'm not sure how best to write a qunit test for this, but the mere inclusion of dist/syn.js in an HTML file causes the page scroll to jump to the bottom in Firefox. I've put an example online at http://sandpit.andrewrn.co.uk/syn.html. This example is just a few paragraphs of Lipsum with syn.js included in the document head. |
|
That works, thanks. I'll see if I can put a test together. |
|
This is most likely caused by the feature detection which types into input fields to see what events are triggered. I'm going to rework the feature detection a bit before we accept this fix, it might not be needed. |
|
Hi Matthew, Yeah - this does come from the feature detection. Look forward to your fix. Thanks, Andrew |
This reworks feature detection just a little bit to move the code into their own modules so they can be seperately tested. Fixes bitovi#30 by moving the feature detection to take place at the beginning of the document instead of the end. Fixes bitovi#29 by waiting until Syn is finished loading before removing window.__synthTest. This is interesting bug, it appears (which I cannot track down definitively) that the issue is that Firefox isn't firing the `javascript:__synthTest()` until after the elements have been removed from the page.
This reworks feature detection just a little bit to move the code into their own modules so they can be seperately tested. Fixes bitovi#30 by moving the feature detection to take place at the beginning of the document instead of the end. Fixes bitovi#29 by waiting until Syn is finished loading before removing window.__synthTest. This is interesting bug, it appears (which I cannot track down definitively) that the issue is that Firefox isn't firing the `javascript:__synthTest()` until after the elements have been removed from the page.
|
That's weird, just tested with the latest master and didn't get that error. Which browser/OS are you using? Reopening this issue as the test is now failing to finish in Firefox 30. |
Fixes the test that was failing in Firefox for bitovi#30. The old test was waiting for the iframe to load and then setting a function on the iframe's window. But Firefox would call `load` after steal had completed, so it was unreliable. The fix is to set the function on the parent window and have the iframe call the `parent.synReady()` function. This guarantees that the function exists before the iframe script has finished running. Should close out bitovi#30
|
Hi @matthewp, It is failing in linux + FF 26.0 and linux + chrome 33. Same error, line 1061: |
In Firefox JavaScript inside an href (for example:
`href="javascript:__synthTest()"` fires well after Syn has loaded.
Instead of trying to predict when it is "safe" to remove this
function, we're just going to leave it alone as it is double
underscored and shouldn't conflict with anything. In the future we
could create a `noConflict` function that removes this. Fixes
lingering issue in bitovi#30
|
Hey @dmonllao If you don't mind, could you pull the |
|
Sure, np, now I see: Uncaught TypeError: Cannot call method 'trigger' of undefined syn.js:1077 |
|
Hey @dmonllao is this happening in master as well? |
|
Hi, As commented #30 (comment), it was failing before 1077, in 1061 |
|
Thanks @dmonllao, sounds like it's unrelated to this change then. Can you post the output of |
We've noticed that when including the syn.js file, the page position changes. In our case, this has the effect of failing some of our behat tests because it is no longer possible to interact with some Nodes if the page overflow has been disabled.
The library should not have an effect on page position in this way.
This seems to be caused by src/key.js at the point that it focuses on the input field. The comment above this is:
Considering Firefox doesn't seem to trigger these key events anyway, I feel that this should be removed.