Using the addEventListener moves focus from clicked objects

RESOLVED INCOMPLETE

Status

()

Firefox
General
RESOLVED INCOMPLETE
10 years ago
8 years ago

People

(Reporter: Tal, Unassigned)

Tracking

3.0 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [CLOSEME 2010-11-01])

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7

Hi,

Consider this HTML (is also attached):

<html>
<head>
<script>
function myclick(){alert('click');return false;}
</script>
</head>
<body>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#">aaaa</a></div>
<div><a href="#" id="check">aaaa</a></div>
<script> document.getElementById('check').addEventListener("click", myclick, false);
</script>
</body></html>

Now load it in a small window in firfox, so you'll see a vertical scrollbar.
Scroll down a little bit, then click on the last text. you'll see that the item has a focus rectangle, but the scrollbar jumps up.

Is this a browser bug? how can I make the scrollbar not to jump and stay in the same location clicked?

Thanks,
Tal. 

Reproducible: Always

Steps to Reproduce:
1.Load the attached HTML, scroll down until the last item and click on it.
2.
3.
Actual Results:  
The scrollbar jumps up to the start instead of staying near the clicked item.

Expected Results:  
Scrollbar doesnt move when clicking on the item.
(Reporter)

Comment 1

10 years ago
Created attachment 368224 [details]
repdocution test case
(Reporter)

Updated

10 years ago
Version: unspecified → 3.0 Branch

Comment 2

9 years ago
That is not a bug, but a feature.
# is a anchor, if you paste this at the end of your page:
<a name="thefooter"></a>
and you go to #thefooter, then you'll be scrolled down.

Instead of using # to 'do nothing', use javascript:void(0);
This is a mass search for Firefox General bugs filed against version 3.0 that are UNCO and have not been changed for 200 days.

Reporter, please update to Firefox 3.6.10 or alter. Firefox 3.0 is no longer supported and is no longer receiving updates. After you update, please create a fresh profile, http://support.mozilla.com/kb/managing+profiles, and test to see if your bug still exists. If you still the bug, then please post a comment with the version you tested against, and the problem. If the issue is no longer there, please set the RESOLUTION to  RESOLVED, WORKSFORME.
Whiteboard: [CLOSEME 2010-11-01]
No reply from reporter, INCOMPLETE. Please retest with Firefox 3.6.12 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.