## Bug description

*Please describe.*  
*If this affects the front-end, screenshots would be of great help.*  

Trailing spaces in the selector box are not removed automatically and can mess up the event results when saving an action

## Expected behavior



## How to reproduce

1. Create a new action with any selector
2. put in a couple of spaces at the end of the line in the selector input box
3. 

## Environment

- Self-managed?
- PostHog version/commit

## Additional context



#### *Thank you* for your bug report – we love squashing them!

posthog/models/event.py
groups = ElementGroup.objects.filter(team_id=team_id)
        if filters.get("selector"):
            selector = Selector(filters["selector"])
            subqueries, filter = self._element_subquery(selector)
            groups = groups.annotate(**subqueries)  
        else:
            filter = {}
        for key in ["tag_name", "text", "href"]:
            if filters.get(key):
                filter["element__{}".format(key)] = filters[key]
        if not filter:
            return {}
        groups = groups.filter(**filter)
        return {"elements_hash__in": groups.values_list("hash", flat=True)}
    def filter_by_url(self, action_step: ActionStep, subquery: QuerySet):