Skip to content

Conversation

TrySound
Copy link
Member

@TrySound TrySound commented May 23, 2025

Ref #3632

This is big one. So I switched to html elements whole forms section in components. Though here I introduced some deviation from specification

Textarea

Initial value is represented as text content

<textarea>content</textarea>

Though it is trickier to manage text content as state and all frameworks rely on value property of textarea dom interface.

Select

Similar story. There is no value attribute and state is represented by selected boolean attribute on options

<select>
  <option value="value1" selected></option>
  <option value="value2"></option>
</select>

We replace selected attribute on option with value attribute on selected when paste.

So basically all form elements are using "value" and "checked" attributes which can be easily mapped to html and all frameworks.

Ref #3632

This is big one. So I switched to html elements whole forms section in
components. Though here I introduced some deviation from specification

**Textarea**

Initial value is represented as text content
```
<textarea>content</textarea>
````

Though it is trickier to manage text content as state and all frameworks
rely on value property of textarea dom interface.

**Select**

Similar story. There is no value attribute and state is represented by
selected boolean attribute on options

```
<select>
  <option value="value1" selected></option>
  <option value="value2"></option>
</select>
```

We replace selected attribute on option with value attribute on selected
when paste.

All other components are migrated smoothly.
@TrySound TrySound requested a review from kof May 23, 2025 22:24
Copy link
Member

@kof kof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to test?

@TrySound
Copy link
Member Author

TrySound commented May 24, 2025

Tested
image

@TrySound TrySound merged commit 4dfdf50 into main May 24, 2025
32 checks passed
@TrySound TrySound deleted the forms.staging branch May 24, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants