#9561 closed bug (invalid)
Bug with multiple class selector
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | unfiled | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I don't know if you had already been aware of this issue:
if you are using live to add eventHandlers, the live function relies on the selector property of JQ object. but the thing is when you are using something like $("div.class1, div.class2").find("a").live, the selector would be incorrect as "div.class1, div.class2 a" which is not as expected.
$("div.class1").find("a").selector = "div.class1 a";
$("div.class1, div.class2").find("a").selector = "div.class1, div.class2 a";
I'm not sure if it is by design or you will fix it.
anyway, jQuery is cool and thx for your efforts!
thx, Kail
Change History (4)
comment:1 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 12 years ago by
??? That DOES sound like a bug to me and not "invalid usage". All the docs say is that attaches "a handler to the event for all elements which match the current selector, now and in the future."
And if the current selector is built incorrectly (as it obviously is) this behavior is unexpected.
comment:3 Changed 12 years ago by
.live() is not meant to work against anything other than a direct selector, which is why $("foo").find("bar").live() will is always considered to be an invalid usage. From the docs:
"DOM traversal methods are not supported for finding elements to send to .live(). Rather, the .live() method should always be called directly after a selector, as in the example above."
comment:4 Changed 12 years ago by
ok, if the only case that the selector property would be used is in the .live() func, it should be fine to ignore this issue. But what if there's anything else other than .live() that has dependency on the selector property, don't you consider it as valid?
As the
.live()
docs indicate, that isn't valid usage.