
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
You cannot programmatically focus an element after you have attempted to focus it while it was hidden (display:none) Β· Issue #4950 Β· jquery/jquery
Description:
Description Possibly related to #4867, I have replicated this in version 3.5.1 and 3.6. The linked example below uses 3.6. I haven't tested Firefox, but both Chrome and Edge display this issue....
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Education
- Photography
- Fitness & Wellness
Content Management System {π}
What CMS is github.com built with?
Github.com employs WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,653,926 visitors per month in the current month.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 5,316,180 paying customers.
The estimated monthly recurring revenue (MRR) is $22,327,958.
The estimated annual recurring revenues (ARR) are $267,935,490.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
focus, issue, jquery, element, div, jwmerrill, focusable, added, events, button, test, case, mgol, sign, programmatically, const, visible, comment, commented, discuss, meeting, issues, displaynone, click, toggle, visibility, attempt, focusincount, focusablefocus, bug, commit, references, native, insted, tabsstage, navigation, search, code, pull, requests, actions, security, attempted, hidden, closed, description, version, display, handler, report,
Topics {βοΈ}
net/joolscaesar/2o089jga/ activity line jquery/src/event mgol added jquery focus events d99a985 jwmerrill mentioned 3px solid green keyup code resolve keycode generating provided test case comment metadata assignees handler calls preventdefault joubu added jquery versions 3 jquery deleted jwmerrill edits type projects toggle visibility focusable div projects milestone 3 test case valid issue 0 closed programmatically focus focus { outline focus inside tested firefox meeting reserved issues weekly meeting 100% complete relationships personal information focused programmatically switched back github focusable element event future attempt div visible = true edge display hide/show toggle visibility issue button $button discuss focus handler preventdefault
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:You cannot programmatically focus an element after you have attempted to focus it while it was hidden (display:none)
articleBody:<!--
Feature Requests:
Please read https://github.com/jquery/jquery/wiki/Adding-new-features
Most features should start as plugins outside of jQuery.
Bug Reports:
Note that we only can fix bugs in the latest version of jQuery.
Briefly describe the issue you've encountered
* What do you expect to happen?
* What actually happens?
* Which browsers are affected?
Provide a *minimal* test case, see https://webkit.org/test-case-reduction/
Use the latest shipping version of jQuery in your test case!
We prefer test cases on JS Bin (https://jsbin.com/qawicop/edit?html,css,js,output) or CodePen (https://codepen.io/mgol/pen/wNWJbZ)
Frequently Reported Issues:
* Self-closing tags broken in jQuery 3.5.0 or newer: please read the [jQuery 3.5.0 blog post](https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/) & the [upgrade guide](https://jquery.com/upgrade-guide/3.5/); see also issue #4681.
-->
### Description ###
Possibly related to #4867, I have replicated this in version 3.5.1 and 3.6. The linked example below uses 3.6. I haven't tested Firefox, but both Chrome and Edge display this issue.
See the following example. There's a focusable div at the top, which has a handler to report (at the bottom of the example) the number of times it is focused. When you click the div, it is only ever focused programmatically, because a handler calls `preventDefault()` on the `mousedown`.
There is a button to toggle the visibility (`display`) of the focusable element, but before showing the element, it attempts to programmatically focus it.
Focusing a `display:none` element is not expected to work, but the issue is what follows.
Once the element is shown, no future attempt to focus the element will work.
HTML:
```
<div id="hideable">
<div id="focusable" tabindex="1">
I am focusable
</div>
</div>
<button id="button">
Toggle visibility
</button>
<div id="output">
Click "I am focusable" to focus. Click "Toggle visibility" to hide/show the focusable element
</div>
```
JS:
```
const $button = $('#button');
const $focusable = $('#focusable');
const $hideable = $('#hideable');
const $output = $('#output');
let focusinCount = 0;
$hideable.on('focusin', function() {
focusinCount++;
$output.text('I felt that ' + focusinCount);
});
let visible = true;
$button.click(function() {
if (visible) {
$hideable.hide();
} else {
$focusable.focus(); // Comment out this to fix
$hideable.show();
}
visible = !visible;
});
$focusable.on('mousedown', function(event) {
event.preventDefault();
$focusable.focus();
})
```
### Link to test case ###
https://jsfiddle.net/JoolsCaesar/2o089jga/
author:
url:https://github.com/JoolsCaesar
type:Person
name:JoolsCaesar
datePublished:2021-10-11T17:43:25.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:13
url:https://github.com/4950/jquery/issues/4950
context:https://schema.org
headline:You cannot programmatically focus an element after you have attempted to focus it while it was hidden (display:none)
articleBody:<!--
Feature Requests:
Please read https://github.com/jquery/jquery/wiki/Adding-new-features
Most features should start as plugins outside of jQuery.
Bug Reports:
Note that we only can fix bugs in the latest version of jQuery.
Briefly describe the issue you've encountered
* What do you expect to happen?
* What actually happens?
* Which browsers are affected?
Provide a *minimal* test case, see https://webkit.org/test-case-reduction/
Use the latest shipping version of jQuery in your test case!
We prefer test cases on JS Bin (https://jsbin.com/qawicop/edit?html,css,js,output) or CodePen (https://codepen.io/mgol/pen/wNWJbZ)
Frequently Reported Issues:
* Self-closing tags broken in jQuery 3.5.0 or newer: please read the [jQuery 3.5.0 blog post](https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/) & the [upgrade guide](https://jquery.com/upgrade-guide/3.5/); see also issue #4681.
-->
### Description ###
Possibly related to #4867, I have replicated this in version 3.5.1 and 3.6. The linked example below uses 3.6. I haven't tested Firefox, but both Chrome and Edge display this issue.
See the following example. There's a focusable div at the top, which has a handler to report (at the bottom of the example) the number of times it is focused. When you click the div, it is only ever focused programmatically, because a handler calls `preventDefault()` on the `mousedown`.
There is a button to toggle the visibility (`display`) of the focusable element, but before showing the element, it attempts to programmatically focus it.
Focusing a `display:none` element is not expected to work, but the issue is what follows.
Once the element is shown, no future attempt to focus the element will work.
HTML:
```
<div id="hideable">
<div id="focusable" tabindex="1">
I am focusable
</div>
</div>
<button id="button">
Toggle visibility
</button>
<div id="output">
Click "I am focusable" to focus. Click "Toggle visibility" to hide/show the focusable element
</div>
```
JS:
```
const $button = $('#button');
const $focusable = $('#focusable');
const $hideable = $('#hideable');
const $output = $('#output');
let focusinCount = 0;
$hideable.on('focusin', function() {
focusinCount++;
$output.text('I felt that ' + focusinCount);
});
let visible = true;
$button.click(function() {
if (visible) {
$hideable.hide();
} else {
$focusable.focus(); // Comment out this to fix
$hideable.show();
}
visible = !visible;
});
$focusable.on('mousedown', function(event) {
event.preventDefault();
$focusable.focus();
})
```
### Link to test case ###
https://jsfiddle.net/JoolsCaesar/2o089jga/
author:
url:https://github.com/JoolsCaesar
type:Person
name:JoolsCaesar
datePublished:2021-10-11T17:43:25.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:13
url:https://github.com/4950/jquery/issues/4950
Person:
url:https://github.com/JoolsCaesar
name:JoolsCaesar
url:https://github.com/JoolsCaesar
name:JoolsCaesar
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:13
interactionType:https://schema.org/CommentAction
userInteractionCount:13
External Links {π}(3)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- jQuery
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net