## 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
@patch("celery.current_app.send_task")
    def test_send_to_slack(self, patch_post_to_slack):
        self.team.slack_incoming_webhook = "http://slack.com/hook"
        action_user_paid = Action.objects.create(team=self.team, name="user paid", post_to_slack=True)
        ActionStep.objects.create(action=action_user_paid, event="user paid")
        event = Event.objects.create(team=self.team, event="user paid", site_url="http://testserver")
        self.assertEqual(patch_post_to_slack.call_count, 1)
        patch_post_to_slack.assert_has_calls(
            [call("posthog.tasks.webhooks.post_event_to_webhook", (event.pk, "http://testserver"))]
        )
class TestSelectors(BaseTest):
    def test_selector_splitting(self):
        selector1 = Selector("div > span > a")
        selector2 = Selector("div span > a")
        selector3 = Selector("div span a")
        selector4 = Selector("div > span a")
        self.assertEqual(len(selector1.parts), 3)
        self.assertEqual(len(selector2.parts), 3)
        self.assertEqual(len(selector3.parts), 3)
        self.assertEqual(len(selector4.parts), 3)
    def test_selector_child(self):
        selector1 = Selector("div span")
        self.assertEqual(
            selector1.parts[0].__dict__, {"data": {"tag_name": "span"}, "direct_descendant": False, "unique_order": 0,},
        )
        self.assertEqual(
            selector1.parts[1].__dict__, {"data": {"tag_name": "div"}, "direct_descendant": False, "unique_order": 0,},
        )
    def test_selector_child_direct_descendant(self):