Closed twschiller closed 2 years ago
Without any info about reproducibility I can't reproduce it. What brick is it? URL?
Tested on https://pbx.vercel.app/bootstrap-5/
[readonly]
at allUsed in:
Tested in:
While working on https://github.com/pixiebrix/pixiebrix-extension/pull/3349 I noticed that safeCssSelector
is being called directly from selector.ts
instead of going through inferSelector
This is probably the cause of the missing sorting, but I don't know how to go through this path (selector.ts) instead of the regular one.
Something similar happens in another file, calling the library without any blacklist/whitelist:
Are these usages correct? Should we make further changes to avoid undesired direct usage of these functions? (e.g. configure linter, use @deprecated
, rename to _fnName
)
Without any info about reproducibility I can't reproduce it. What brick is it? URL?
Apologies for the lack of information. It's the JQuery Brick on this page when you select the employee id field: https://developer.automationanywhere.com/challenges/automationanywherelabs-employeedatamigration.html
This is probably the cause of the missing sorting, but I don't know how to go through this path (selector.ts) instead of the regular one.
IIRC, this call is for uniquely identifying an element on the page. It's not about generating a list of human-readable selectors. In this case, I think even random CSS module names would be OK?
Something similar happens in another file, calling the library without any blacklist/whitelist:
I think this is the same situation, where we're using the selector generated to pass the selected element across contexts. The selector is never showed to the user?
EDIT: apologies for accidentally hitting close instead of comment 🤦
In sorting our inferred selectors, we should prefer id-like selectors. Not sure if this is a new bug, or didn't work previously
In the below example, the id selector should appear before the attribute selector, even though the attribute selector is shorter
As part of implementing, we should add a test case too