I found following problem in FF 3.0.9 (it looks it is FF problem only). See few lines of code below:
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <title>TEST</title>
- <script type="text/javascript">
- function act() {
- document.getElementById('p_id').innerHTML = '';
- }
- </script>
- </head>
- <body style="padding: 400px;">
- <p id="p_id"><input type="text" id="text" onkeypress="javascript: act();" /></p>
- <a href="javascript://" onclick="javascript: act();">remove by click</a>
- </body>
- </html>
There is function act() that clear content of P element. To reproduce problem start with click on link "remove by click". After click you can try use PgUp and PgDown keys. You can see that
scrolling of page works without problem. Then refresh page and insert cursor in the text field and try type anything.
After first press, handler is executed and content of P is deleted (same function act()). !!Only difference is that scolling
through PgUp and PgDown keys does not work after this action!!. This problem is in FF only (tested IE6,IE7, Opera).
This is only model. I use similar function to change value in table cell and in keydown handler catch ENTER.
Then I save data through AJAX to database ..after response is cell replaced by new value (but scrolling doesnt work).
Is it firefox internal problem? Any idea how to make scrolling works in FF after keypress?
Thanks
Rosta