Skip to content

Thoughts on creating unique selectors #3

@darcyclarke

Description

@darcyclarke

@richgilbank you mentioned you may have something in the works for this. Would love a peak/insight. I know right now we store the HTMLElement Object, which isn't ideal.

Eventually, we'll need to do something like JSON.stringify( this.dssEvents ) and storing element objects wouldn't be great if we want the output to be pretty-printed for manual manipulation/storage. I think the best case scenario is to be able to store a selector string.

One strategy could be:

  1. Check for an id
  2. Fallback: Generate a selector for the element, based on its attributes and tagname, then find it's position relative to any other elements matching that selector (thus, creating a unique selector string)

I may mock this out if I have time but let me know your thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions