PDA

View Full Version : [CLOSED] :contains pseduo selector not supported



mankz
19 May 2014, 3:51 AM
From the Ext 4 docs. http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.dom.Query


E:contains(foo) E's innerHTML contains the substring "foo"


This pseudo selector crashes in Ext 5 - has this support been dropped? Is this documented?

-- test case added by mitchellsimoens

1. http://dev.sencha.com/ext/5.0.0/examples/kitchensink/#basic-panels
2. In the console: Ext.select('div:contains(foo)')

mitchellsimoens
19 May 2014, 4:15 AM
It's working for me:

5v5

mankz
19 May 2014, 5:16 AM
Nope.

1. http://dev.sencha.com/ext/5.0.0/examples/kitchensink/#basic-panels

2. In the console: Ext.select('div:contains(foo)')


SyntaxError: An invalid or illegal string was specified


Filtered chrome url chrome://firebug/content/console/commandLineExposed.js

mitchellsimoens
19 May 2014, 5:34 AM
Thank you for providing steps to reproduce. Please post steps or a test case when reporting a bug. Ext.dom.Query.select works as Ext.select does not because it does different things. Ext.select uses Ext.fly(document).query('div:contains(foo)') which is what fails.

evant
19 May 2014, 5:39 AM
The default is to use QSA now, contains() isn't a standard selector, so it's only available when using the JS selectors.

Support for those won't be removed, however they won't be the default. To get custom selectors you'd need to specifically invoke the JS matcher.

Probably worth mentioning in the upgrade guide. I think it has something about the default selector being different, but we should enumerate what that actually means.

mankz
19 May 2014, 9:21 PM
Thanks for the clarification!