OpenUI5 support and dashes in Ids when defining actions
Feature request
Is your feature request related to a problem?
Please describe.
Our frontend is built with OpenUI5, which writes element IDs containing dashes,
e.g. adminui---appOverviewView--deleteAppButton. Dashes are not accepted in the
selectors of an action, so our product owner cannot define actions on our UI at
all — every tracking point has to go through a developer first.
Describe the solution you'd like
Allow dashes in action selectors.
Describe alternatives you've considered
- Adding dash-free
data-attrhooks to the elements — requires a developer for every element we want to track, which is exactly what we want to avoid. - Assigning custom IDs — UI5 still prefixes them with the view hierarchy, so the dashes remain.
Additional context
Debug info
- [ ] PostHog Cloud, region and project ID: [please provide, you can find both at https://app.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]
Hello, just to confirm, what are your thoughts on doing a straightforward validation-regex change or is there a reason dashes were excluded originally?
Hi,
The documentation states:
The following patterns are not currently supported:
Wildcard operators (e.g. *, ~, |) Combining multiple attribute selectors Non-alphanumeric classes (like classes containing -, [], .)
and i can confirm it does not work. I wasn't further looking into the actions because our PO should be able to define them ideally with the toolbar posthog is providing
@PostHog/team-web-analytics likely related to autocapture and actions, does not look like an SDK thing
We re-checked this on the current version. Action selectors with dashes in the id or class, such as #adminui---appOverviewView--deleteAppButton, now save without a warning and match the right clicked elements (and not elements with a different id). Closing as completed, but please reopen or comment if the toolbar or an action in your project still rejects or misses your selector.