## 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
action2 = Action.objects.create(team=self.team)
        ActionStep.objects.create(action=action2, url="123", url_matching=ActionStep.CONTAINS)
        action3 = Action.objects.create(team=self.team)
        ActionStep.objects.create(
            action=action3, url="https://posthog.com/%/123", url_matching=ActionStep.CONTAINS,
        )
        action4 = Action.objects.create(team=self.team)
        ActionStep.objects.create(
            action=action4, url="/123$", url_matching=ActionStep.REGEX,
        )
        event1 = Event.objects.create(team=self.team, distinct_id="whatever")
        event2 = Event.objects.create(
            team=self.team,
            distinct_id="whatever",
            properties={"$current_url": "https://posthog.com/feedback/123"},
            elements=[Element(tag_name="div", text="some_other_text", nth_child=0, nth_of_type=0,)],
        )
        events = Event.objects.filter_by_action(action1)
        self.assertEqual(events[0], event2)
        self.assertEqual(len(events), 1)
        events = Event.objects.filter_by_action(action2)
        self.assertEqual(events[0], event2)
        self.assertEqual(len(events), 1)
        events = Event.objects.filter_by_action(action3)
        self.assertEqual(events[0], event2)
        self.assertEqual(len(events), 1)
        events = Event.objects.filter_by_action(action4)
        self.assertEqual(events[0], event2)
        self.assertEqual(len(events), 1)
    def test_person_with_different_distinct_id(self):