## 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/models/event.py
parts: List[SelectorPart] = []
    def __init__(self, selector: str):
        self.parts = []
        tags = re.split(" ", selector)
        tags.reverse()
        for index, tag in enumerate(tags):
            if tag == ">":
                continue
            direct_descendant = False
            if index > 0 and tags[index - 1] == ">":
                direct_descendant = True
            part = SelectorPart(tag, direct_descendant)
            part.unique_order = len([p for p in self.parts if p.data == part.data])
            self.parts.append(copy.deepcopy(part))
class EventManager(models.QuerySet):
    def _element_subquery(self, selector: Selector) -> Tuple[Dict[str, Subquery], Dict[str, Union[F, bool]]]: