## 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
if not action_step.url:
            return subquery
        if action_step.url_matching == ActionStep.EXACT:
            where, param = "properties->>'$current_url' = %s", action_step.url
        elif action_step.url_matching == ActionStep.REGEX:
            where, param = "properties->>'$current_url' ~ %s", action_step.url
        else:
            where, param = "properties->>'$current_url' LIKE %s", f"%{action_step.url}%"
        return subquery.extra(where=[where], params=[param])
    def filter_by_event(self, action_step):
        if not action_step.event:
            return {}
        return {"event": action_step.event}
    def filter_by_period(self, start, end):
        if not start and not end:
            return {}
        if not start:
            return {"created_at__lte": end}
        if not end:
            return {"created_at__gte": start}
        return {"created_at__gte": start, "created_at__lte": end}
    def add_person_id(self, team_id: int):
        return self.annotate(
            person_id=Subquery(
                PersonDistinctId.objects.filter(team_id=team_id, distinct_id=OuterRef("distinct_id"))
                .order_by()
                .values("person_id")[:1]
            )
        )
    def query_db_by_action(self, action, order_by="-timestamp", start=None, end=None) -> models.QuerySet: