## 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
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": True, "unique_order": 0},
        )
    def test_selector_attribute(self):
        selector1 = Selector('div[data-id="5"] > 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", "attributes__attr__data-id": "5"},
                "direct_descendant": True,
                "unique_order": 0,
            },
        )
    def test_selector_id(self):
        selector1 = Selector('[id="5"] > span')
        self.assertEqual(
            selector1.parts[0].__dict__, {"data": {"tag_name": "span"}, "direct_descendant": False, "unique_order": 0,},
        )
        self.assertEqual(
            selector1.parts[1].__dict__, {"data": {"attr_id": "5"}, "direct_descendant": True, "unique_order": 0},
        )
    def test_class(self):