-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Performance: changePage() searches the entire document for :focus elements #1560
Comments
I'll try to address this as part of the path navigation re-working I'm doing. |
Related changePage() performance issue: |
Hey Kin, looking into this, unless I'm missing something On the other hand, if you are actually referring to |
But the add() searches the document doesn't it? |
Doh! Right you are. I was looking at the wrong alternate signatures of .add(). http://api.jquery.com/add/ Nevermind. :-) |
Something worth speed-testing: I bet |
jsperf comparison? |
Is this still a concern? Already fixed? |
We're still searching for :focus elements, so this should stay open. |
See also #1855 |
Related to #4340 |
Hey @jaspermdegroot @jblas This issue is super old (has it really been 3 years since 2011?!?) Can you confirm whether this is still an issue or if it has been fixed with new releases of JQM? Thanks! |
@ldeluca Even though this is super old, the issue/performance loss is still valid. Seaching jquery.mobile-1.4.5.js line 5573 reveals that this is still an issue: // Kill the keyboard. |
If we end up keeping the selector we need to change it to @arschmitz Could you please weigh in? Here's the code in question. |
We discussed this today it does not look like there is any case where this will actually happen. so lets go ahead and remove this, and clean it up. |
This is fixed on master already |
In changePage() I see this:
$( window.document.activeElement || "" ).add( "input:focus, textarea:focus, select:focus" ).blur();
This will cause JQM to search the entire document every time we change pages just to release keyboard focus. Instead, we should probably be using a live("focus") handler and tracking the currently focused element so we don't have to crawl the document.
The text was updated successfully, but these errors were encountered: