## 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/test/test_event_model.py
Person.objects.create(team=self.team, distinct_ids=["person1"], properties={"$browser": "Chrome"})
        Event.objects.create(event="$pageview", distinct_id="person1", team=self.team)
        action = Action.objects.create(name="pageview", team=self.team)
        ActionStep.objects.create(
            action=action, event="$pageview", properties=[{"key": "$browser", "value": "Chrome", "type": "person"}],
        )
        action.calculate_events()
        self.assertEqual(action.events.count(), 1)
    def test_empty(self):
        Person.objects.create(team=self.team, distinct_ids=["person1"], properties={"$browser": "Chrome"})
        action = Action.objects.create(name="pageview", team=self.team)
        ActionStep.objects.create(
            action=action, event="$pageview", properties=[{"key": "$browser", "value": "Chrome", "type": "person"}],
        )
        action.calculate_events()
        self.assertEqual(action.events.count(), 0)
class TestSendToSlack(BaseTest):