When a style property (e.g. width) contains a CSS function like calc(90vw - 100px), pressing backspace anywhere in the input field deletes the entire value instead of just the character before the cursor.
Steps to reproduce:
-
Set a width (or other property) to a CSS function, e.g.
calc(90vw - 100px) -
Click away from the input to deselect it
-
Click back into the input and place your cursor somewhere in the middle
-
Press backspace
Expected: Only the character before the cursor is deleted
Actual: The entire input value gets deleted
Workaround: Type any character first, then backspace works normally.
Notes: This only occurs when the value is a CSS function. Regular values like 100px or 50% don’t have this issue.