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

In Firefox (v24), initialisation of keyboard jumps to top of the document #213

Closed
harrywebdev opened this issue Oct 25, 2013 · 12 comments
Closed
Labels

Comments

@harrywebdev
Copy link

Even with settings appendLocally: true (at first I thought it's issue due to appending to the body). Can check it on the demo page in Firefox v24
http://mottie.github.io/Keyboard/layouts.html

when changing the layout (and being scrolled down on the page), after initialisation it jumps back to top.

PS: thanks for great plugin! ;-)

@Mottie
Copy link
Owner

Mottie commented Oct 25, 2013

Hi @hery-potr! (I see what you did there! LOL)

I'm not sure what to tell you... I see the same problem in IE10, but not in Chrome. I'll have to do a bit more digging to find the source of this problem.

Thanks for reporting it!

@ghost
Copy link

ghost commented Nov 2, 2013

Just tested with Firefox 25 and didn't notice any problem.

@harrywebdev
Copy link
Author

Hi Mottie! :-))
Thanks!

@theplague Just tested in FF v25 (on Win) and still doing it, if you make your window smaller, scroll to the bottom and change the layout from selectbox, it flicks back to top - don't yours?

@Mottie
Copy link
Owner

Mottie commented Nov 6, 2013

Yeah, it's still happening to me too... I just haven't had time to figure out the problem - too many projects to juggle!

@foxdonut
Copy link

Experiencing this now... seeing the dates on those comments, is there any hope that this will get fixed? Thanks in advance... awesome plugin!

@Mottie
Copy link
Owner

Mottie commented Oct 29, 2014

Hi @foxdonut!

Try the plugin code within the working branch of this repository. It doesn't appear to be causing this issue any more.

Please note that you no longer need to destroy the plugin to change the layout - see issue #183 for the code and a demo.

@foxdonut
Copy link

Hi @Mottie!

Thank you for the suggestion! However, no luck. I still get the behaviour with the working branch.

But you might still be able to help. You see, I am not changing the layout of the keyboard. Instead, I am just dynamically adding a new section to the page (after clicking on a button), and the new section includes fields that use the keyboard. When I create a new keyboard with element.keyboard(config) in the new section, that's when the behaviour of jumping back to the top of the page occurs.

Any ideas?

Thanks again, I appreciate your help!

@foxdonut
Copy link

foxdonut commented Nov 4, 2014

@Mottie : issue seems fixed if I replace this line:

        base.temp = $('<input style="position:absolute;left:-9999em;top:-9999em;" type="text" value="testing">')
            .appendTo('body').caret(3,3);

with this:

        base.temp = $('<input style="position:absolute;left:-9999em;top:-9999em;" type="text" value="testing">')
            .appendTo(el).caret(3,3);

Adding the element to the body is what makes the jump to the top of the page. Since that element is temporary and gets removed after anyway, I added it to the current element instead, preventing the jump.

Thanks again for responding. Hope this helps!

@Mottie
Copy link
Owner

Mottie commented Nov 4, 2014

Hey @foxdonut!

Thanks for sharing, I'll test it out!

@Mottie
Copy link
Owner

Mottie commented Nov 5, 2014

Ok, I think it's fixed now. I completely removed the absolute positioning, which I think was the main culprit. and instead added a div with no width or height with an input inside.

I appreciate the help in narrowing down the problem!

@foxdonut
Copy link

foxdonut commented Nov 6, 2014

Thanks @Mottie ! I'll test it out when it is merged to master. Thank you for this great plugin!

@Mottie Mottie closed this as completed in 71e78de Nov 20, 2014
@Mottie
Copy link
Owner

Mottie commented Nov 20, 2014

Ok, this should be fixed in 1.19.0. Thanks for your patience!

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

No branches or pull requests

3 participants