## 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
def test_update_or_delete_action_steps(self):
        user_signed_up = Event.objects.create(event="user signed up", team=self.team)
        user_logged_in = Event.objects.create(event="user logged in", team=self.team)
        user_logged_out = Event.objects.create(event="user logged out", team=self.team)
        action = Action.objects.create(team=self.team, name="combined action")
        step1 = ActionStep.objects.create(action=action, event="user signed up")
        step2 = ActionStep.objects.create(action=action, event="user logged in")
        with self.assertNumQueries(6):
            action.calculate_events()
        self.assertEqual(
            [e for e in action.events.all().order_by("id")], [user_signed_up, user_logged_in],
        )
        
        step2.event = "user logged out"
        step2.save()
        with self.assertNumQueries(6):
            action.calculate_events()
        self.assertEqual(
            [e for e in action.events.all().order_by("id")], [user_signed_up, user_logged_out],
        )
        
        ActionStep.objects.filter(pk=step2.pk).delete()
        action.calculate_events()
        self.assertEqual([e for e in action.events.all().order_by("id")], [user_signed_up])
        ActionStep.objects.all().delete()
        action.calculate_events()
        self.assertEqual([e for e in action.events.all().order_by("id")], [])
    def test_save_with_person_property(self):