Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5961057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:54:42+00:00 2026-05-22T18:54:42+00:00

Firefox has a behavior where, if you click on a scrollable div , then

  • 0

Firefox has a behavior where, if you click on a scrollable div, then that div responds to all the mousewheel and the Page Up/Down keys, effectively making it “focused”. However, the HTML5 spec dictates that divs cannot be “focused”, technically. Therefore, even though the div receives keyboard and mouse events, it’s not reported in document.activeElement or a DOMActivate event handler.

So how can I detect when a scrollable div has scrolling focus in Firefox? Here’s a test page. Oddly, the div is reported in document.activeElement when you tab into it, but that’s the only time that happens. A workaround might be to listen for click and scroll events instead, but I’m not sure if that’s the best solution?

EDIT: This is for a Firefox extension, so any chrome-level JS would be acceptable. This also means I can’t edit or predict how certain pages are coded.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:54:43+00:00Added an answer on May 22, 2026 at 6:54 pm

    If you assign the <div> a tabindex attribute/property (you can set it to 0 to make it focusable in the normal flow of the document, or -1 to remove it from the normal tab flow entirely), then it can fire focus and blur events. Some simple CSS can eliminate the outline if you find it undesirable, but it may be desirable for usability reasons.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firefox has this annoying behavior that it let's the user drag and drop any
Firefox 3 has introduced a new behavior in which line-height, when unset, differs from
Firefox has this nice find-a-text-on-the-page dialog, which is non-modal and shows up at the
I've read that Firefox 3.5 has a new feature in its parser ? Improvements
Update: This question has been solved, so the buggy Firefox behavior will no longer
I found out IE has different behavior vs Firefox when I use this $('head').prepend('');
I have a page that works on firefox and chrome. In IE7 i'm experiencing
My default page works fine in ie but Firefox it has problems with the
This is a confusing behavior that I'm seeing in FireFox and Chrome: I have
Lets say I have a main page which has a link that opens a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.