html - Unexpected scrolling when tabbing through form fields in slider (Chrome) -
I have a form inside a javascript slider. If I already use the tab key to focus on the form field containing the content, then the browser scrolls the slider unexpectedly. I've seen it in Chrome only (version 40.0.2214.91 (64-bit) Ubuntu 14.04) I was wondering if anyone else has experienced this experience, and if you are able to find work around Were?
Here is a code snippet I use to reproduce this issue and contribute terms:
. Viewport {range: 2px solid blue; Width: 400px; Hidden flurry; } .slider {border: 2px solid red; Width: 600px; } .form-wrapper {width: 200px; Border: 2px solid green; } Input {width: 190px; } & lt; Div class = "viewport" & gt; & Lt; Div class = "slider" & gt; & Lt; Div class = "form-wrapper" & gt; & Lt; Form action = "#" & gt; & Lt; Input type = "text" name = "field 1" /> & Lt; Input type = "text" name = "field2" value = "field2" /> & Lt; / Form & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; P & gt; Click on field 1, then press tab to pay attention to field 2. & Lt; / P & gt; - The parent is using the div overflow: hidden
- Child div, parent is greater than div
- Using tab key to change field focus
- Form field already has value for receiving forest
- Until now, only Chrome in Chrome
- Chrome auto-complete is not being disabled / enabled for any effect < P> Report this problem here The went feels like one, but the situation is completely do not are not equal (using overflow horizontal, rather than vertical scrolling Hidden) So, maybe the issue is also under other conditions than mine.
I have found a quick fix for this, sometimes it seems a little bit, but when If you focus on an input in the slider, then adding an event handler is included.
This is my code
$ ('.bx-viewport input'). Focusin (function () {setTimeout (function ()} // // setTimeout ensures that this is the original problem (this is a delay) after $ ('.bx-viewport'). ScrollLeft (0);}, 0);});
So your solution should be to find out which element is being applied to the scroll left and it is set to zero.
It works jsfiddle:
Comments
Post a Comment