Ivan Starkov d69b2622d7 CSSValueInput ESC support, do not save if nothing has changed (#673)
ref #656
closes #644


## 1 Case is not fixed in this PR

Click unit px
Hover over items
Press ESC - instead of closing menu it resets input and only 2nd ESC
closes the menu.

Will do in next PR




## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

### Save behavior

**Case 1.**
Click into "resetted" input field 
Click outside - no Blue background at the input label should appear.

**Case 2.**
Start typing something in "resetted" input field.
Click ESC,
Click outside - no Blue background at the input label should appear.

**Case 3.**
Open menu in "resetted" input field. 
Hover over menu items.
Click outside - no Blue background at the input label should appear.

**Case 4.**
Start typing "au" in "resetted" input field. 
Hover over menu items.
Click ESC - menu closes.
Click ESC - value resetted.
Click outside - no Blue background at the input label should appear.

** Case 5.**
Click into the "resetted" field with `unit` value.
Delete all with delete button.
Click ESC - menu closes.
Click "ESC" - should reset to prev value
Click ouside - no Blue background at the input label should appear.

** Case 6 **
Click into the "resetted" field
Click ENTER - Blue background should appear

** Case 7 **
Click into the "resetted" field
Edit value so after Edit it will the same
Click outside - Blue background should appear



### ESC

**Case 1**
find a numeric CSS value input
change the value with some number
press ESC
number resets to the initial value

**Case 2**
find a keyword CSS value input
start typing
autocomplete list is shown
press ESC
list is closed
press ESC
value resets to initial value

**Case 3**
find a numeric CSS value input
type some number
click on unit button - list shows
press ESC - list closes
press ESC - value resets to initial value

**Case 4**
Write `autoblabla` in input
press ESC - value resets to initial value

**Case 5**
Click on menu open button
Click ESC - menu should be closed


## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-designer/blob/main/apps/designer/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `designer/env-check.js` if mandatory
2022-12-22 15:12:12 +03:00
2022-07-04 19:59:42 +02:00
2022-12-08 12:07:05 +04:00
2022-07-22 19:18:21 +00:00
2022-06-22 15:00:00 +02:00
2022-03-13 04:22:21 +00:00
2022-04-13 12:14:56 +01:00
2022-12-17 21:50:59 +01:00

Webstudio Designer

Webstudio Designer is a NoCode Visual Tool inspired by Webflow. It is the place where you can build your site or app visually.

Contributing

Don't hesitate to reach out of you have questions around contributing to the project.

Contributing guide

Community

Twitter

Discussions

Discord

Languages
TypeScript 98.9%
PLpgSQL 0.5%
CSS 0.3%
Shell 0.2%
JavaScript 0.1%