## 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
direct_descendant = False
    unique_order = 0
    def _unescape_class(self, class_name):
        
        return "\\".join([p.replace("\\", "") for p in class_name.split("\\\\")])
    def __init__(self, tag: str, direct_descendant: bool):
        self.direct_descendant = direct_descendant
        self.data: Dict[str, Union[str, List]] = {}
        result = re.search(attribute_regex, tag)
        if result and "[id=" in tag:
            self.data["attr_id"] = result[3]
            tag = result[1]
        if result and "[" in tag:
            self.data["attributes__attr__{}".format(result[2])] = result[3]
            tag = result[1]
        if "nth-child(" in tag:
            parts = tag.split(":nth-child(")
            self.data["nth_child"] = parts[1].replace(")", "")
            tag = parts[0]
        if "." in tag:
            parts = tag.split(".")
            
            self.data["attr_class__contains"] = [self._unescape_class(p) for p in parts[1:]]
            tag = parts[0]
        if tag:
            self.data["tag_name"] = tag
    @property
    def extra_query(self) -> Dict[str, List[Union[str, List[str]]]]: