I thought the "cancel" button was for "close the slider", whereas it seems that it means "erase unsaved changes". I was opening a new issue when I realized this.
Maybe it could be rephrased, and a close button could be added because it is not always straight-forward to have to click outside the slider to close it. Or the existing button could be "erase unsaved changes AND close the slider".