## 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
Person.objects.create(distinct_ids=["whatever"], team=self.team)
        action1 = Action.objects.create(team=self.team)
        ActionStep.objects.create(action=action1, selector="a.na\\\\v-link\\:b\\@ld", tag_name="a")
        event1 = Event.objects.create(
            team=self.team,
            distinct_id="whatever",
            elements=[
                Element(tag_name="span", attr_class=None),
                Element(tag_name="a", attr_class=["na\\v-link:b@ld"]),
            ],
        )
        events = Event.objects.filter_by_action(action1)
        self.assertEqual(events[0], event1)
        self.assertEqual(len(events), 1)
    def test_with_class_with_escaped_slashes(self):
        Person.objects.create(distinct_ids=["whatever"], team=self.team)
        action1 = Action.objects.create(team=self.team)
        ActionStep.objects.create(action=action1, selector="a.na\\\\\\\\\\\\v-link\\:b\\@ld", tag_name="a")
        event1 = Event.objects.create(
            team=self.team,
            distinct_id="whatever",
            elements=[
                Element(tag_name="span", attr_class=None),
                Element(tag_name="a", attr_class=["na\\\\\\v-link:b@ld"]),
            ],
        )
        events = Event.objects.filter_by_action(action1)
        self.assertEqual(events[0], event1)
        self.assertEqual(len(events), 1)
    def test_attributes(self):