Component name as dom node id

Could we have the name of anvil components used as the id of the resulting html elements?

It would greatly ease the selection of a component from e.g. CSS or selenium.

If that’s not feasible (repeating panels come to mind), how about assigning a unique id and making that available both in the dom and as a component property that’s visible but read only in the ide?

2 Likes

In the meantime, what I’d suggest is using anvil.js.get_dom_node(component), then setting an ID (or class) for Selenium’s benefit using the DOM APIs.

3 Likes

Yep, that’s exactly what I’m doing at the moment!