Opened 10 years ago
Closed 9 years ago
#9178 closed bug (fixed)
Menu item click causes page scroll
Reported by: | tooparam | Owned by: | tooparam |
---|---|---|---|
Priority: | minor | Milestone: | 1.11.0 |
Component: | ui.menu | Version: | 1.9.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Whenever I choose an item in the menu, it causes whole page scroll.
Change History (7)
comment:1 Changed 10 years ago by
Owner: | set to tooparam |
---|---|
Status: | new → pending |
comment:3 Changed 10 years ago by
Ok I see this. This is fixed easily enough be adding a preventDefault()
call but I'm guessing there might be some focus related reason we're not doing that here (https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.menu.js#L66)... so I'll wait for others to chime in.
If you need a workaround just add an event handler that prevents the default action: http://jsfiddle.net/tj_vantoll/FT5K9/.
comment:4 Changed 10 years ago by
scott.gonzalez / kborchers
We had chatted about his one in IRC awhile ago (http://irc.jquery.org/%23jqueryui-dev/%23jqueryui-dev_20130325.log.html) but I don't know if we ever came to a consensus over what we wanted to do here. Thoughts?
comment:5 follow-up: 6 Changed 10 years ago by
My thought is that we should stop using anchors and just let the main element be the focusable content. I don't remember why anchors were used.
comment:6 Changed 10 years ago by
Status: | new → open |
---|
Replying to scott.gonzalez:
My thought is that we should stop using anchors and just let the main element be the focusable content. I don't remember why anchors were used.
Seems reasonable. I'm going to mark this as valid because I do think the described behavior is a bug.
comment:7 Changed 9 years ago by
Milestone: | none → 1.11.0 |
---|---|
Resolution: | → fixed |
Status: | open → closed |
Anchors are no longer used as of 1.11.0. See #10130.
Hi tooparam,
Thanks for taking the time to contribute to the jQuery UI project. In order to assess this ticket we need a reduced test case that shows the issue. You can use this as a starting point http://jsfiddle.net/tj_vantoll/jCTEP/.
Thanks.