## 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 _signup_event(self, distinct_id: str):
        sign_up = Event.objects.create(
            distinct_id=distinct_id,
            team=self.team,
            event="$autocapture",
            elements=[Element(tag_name="button", text="Sign up!")],
        )
        return sign_up
    def _movie_event(self, distinct_id: str):
        event = Event.objects.create(
            distinct_id=distinct_id,
            team=self.team,
            event="$autocapture",
            elements=[
                Element(
                    tag_name="a",
                    attr_class=["watch_movie", "play"],
                    text="Watch now",
                    attr_id="something",
                    href="/movie",
                ),
                Element(tag_name="div", href="/movie"),
            ],
        )
        return event
    def test_simple_element_filters(self):