## 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
ActionStep.objects.create(event="$autocapture", action=action1, selector="div > div > a")
        ActionStep.objects.create(
            event="$autocapture", action=action1, selector="div > a.somethingthatdoesntexist",
        )
        action1.calculate_events()
        events = Event.objects.filter_by_action(action1)
        self.assertEqual(len(events), 1)
        self.assertEqual(events[0], event2)
        
        action2 = Action.objects.create(team=self.team)
        ActionStep.objects.create(action=action2, selector="div > a:nth-child(2)")
        action2.calculate_events()
        events = Event.objects.filter_by_action(action2)
        self.assertEqual(len(events), 1)
        self.assertEqual(events[0], event2)
        
        action3 = Action.objects.create(team=self.team)
        ActionStep.objects.create(action=action3, selector="[id='someId']")
        action3.calculate_events()
        events = Event.objects.filter_by_action(action3)
        self.assertEqual(len(events), 1)
        self.assertEqual(events[0], event2)
        
        action4 = Action.objects.create(team=self.team, name="action1")
        ActionStep.objects.create(event="$autocapture", action=action4, selector="[id='nested'] a")
        action4.calculate_events()
        events = Event.objects.filter_by_action(action4)
        self.assertEqual(len(events), 1)
        self.assertEqual(events[0], event1)
    def test_with_normal_filters(self):