Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294795

Convert type selectors to be compatible with jQuery native-API selector

$
0
0

Problem/Motivation

Convert type selectors to be compatible with with jQuery native-API selector

Proposed resolution

Follow this replacement pattern:

$( ":button" ) -> $( "button, input[type='button']" ).
$( ":checkbox" ) -> $( "[type=checkbox]" )
$( ":file" ) -> $( "[type="file"]" )
$( ":image" ) -> $( "[type="image"]" )
$( ":password" ) -> $( "[type=password]" )
$( ":radio" ) -> $( "[type=radio]" )
$( ":reset" ) -> $( "[type=reset]" )

when using :hidden to select elements, first select the elements using a pure CSS selector, then use .filter(":hidden").
:submit : for better performance in modern browsers, use input[type="submit"], button[type="submit"] instead.
:text : for better performance in modern browsers, use [type="text"] instead.

Remaining Tasks

The most recent patch was created several years before the switch to .es6.js files, so it's likely easier to recreate the changes manually vs applying the patch. An issue fork has been created with a few changes, and contributors should just expand on that as needed using the replacement pattern above.


Viewing all articles
Browse latest Browse all 294795

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>