## 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
TEAM_EVENT_ACTION_QUERY_CACHE[self.team_id].update(qcache)
            
            LAST_UPDATED_TEAM_ACTION[self.team_id] = last_updated_action_ts
        else:
            
            
            actions.raw(TEAM_ACTION_QUERY_CACHE[self.team_id])
            
            q, p = TEAM_EVENT_ACTION_QUERY_CACHE[self.team_id][self.event]
            
            qp = tuple([self.pk if i == "%s" else i for i in p])
            with connection.cursor() as cursor:
                
                qstring = cursor.mogrify(q, qp)
                cursor.execute(qstring)
                events = namedtuplefetchall(cursor)
        event = [event for event in events][0]
        filtered_actions = [action for action in actions if getattr(event, "action_{}".format(action.pk), None)]
        return filtered_actions
    created_at: models.DateTimeField = models.DateTimeField(auto_now_add=True, null=True, blank=True)
    objects: EventManager = EventManager.as_manager()  
    team: models.ForeignKey = models.ForeignKey(Team, on_delete=models.CASCADE)
    event: models.CharField = models.CharField(max_length=200, null=True, blank=True)
    distinct_id: models.CharField = models.CharField(max_length=200)
    properties: JSONField = JSONField(default=dict)
    timestamp: models.DateTimeField = models.DateTimeField(default=timezone.now, blank=True)
    elements_hash: models.CharField = models.CharField(max_length=200, null=True, blank=True)
    
    elements: JSONField = JSONField(default=list, null=True, blank=True)