Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions apps/website/docs/api/03-html/09-option.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ To display an item within `<html.select>`, render the `<html.option>` component.
import { html } from 'react-strict-dom';

const Foo = () => (
<html.select>
<html.option>Red</html.option>
<html.select value="red">
<html.option value="red">Red</html.option>
</html.select>
);
```
Expand All @@ -25,5 +25,4 @@ const Foo = () => (
* [...Common props](/api/html/common/)
* `disabled`
* `label`
* `selected`
* `value`
8 changes: 5 additions & 3 deletions apps/website/docs/api/03-html/10-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ title: <html.select>

## Overview

To display a select box, render the `<html.select` component.
To display a select box, render the `<html.select>` component.

```jsx
import { html } from 'react-strict-dom';

const Foo = () => (
<html.select>
<html.option>Red</html.option>
<html.select value="red">
<html.option value="red">Red</html.option>
</html.select>
);
```
Expand All @@ -24,6 +24,7 @@ const Foo = () => (

* [...Common props](/api/html/common/)
* `autoComplete`
* `defaultValue`
* `multiple`
* `name`
* `required`
Expand All @@ -32,3 +33,4 @@ const Foo = () => (
* `onInput`
* `onInvalid`
* `onSelect`
* `value`
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ export type StrictReactDOMOptionProps = $ReadOnly<{
...StrictReactDOMProps,
disabled?: ?boolean,
label?: ?Stringish,
selected?: ?boolean,
value?: ?Stringish
}>;
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ import type { AutoComplete, StrictReactDOMProps } from './StrictReactDOMProps';
export type StrictReactDOMSelectProps = $ReadOnly<{
...StrictReactDOMProps,
autoComplete?: AutoComplete,
defaultValue?: ?(Stringish | Array<Stringish>),
multiple?: ?boolean,
name?: ?string,
required?: ?boolean,
onBeforeInput?: $FlowFixMe,
onChange?: $FlowFixMe,
onInput?: $FlowFixMe,
onInvalid?: $FlowFixMe,
onSelect?: $FlowFixMe
onSelect?: $FlowFixMe,
value?: ?(Stringish | Array<Stringish>)
}>;
Original file line number Diff line number Diff line change
Expand Up @@ -5070,7 +5070,6 @@ exports[`html "option" supports inline event handlers 1`] = `
exports[`html "option" supports input attributes 1`] = `
<option
className="html-option"
defaultValue="defaultValue"
disabled={true}
label="label"
ref={null}
Expand Down Expand Up @@ -5647,6 +5646,7 @@ exports[`html "select" ignores and warns about unsupported attributes 1`] = `
exports[`html "select" supports additional select attributes 1`] = `
<select
className="html-select x1y0btm7 x1ghz6dp x1717udv"
defaultValue="defaultValue"
disabled={true}
name="user-language"
onBeforeInput={[Function]}
Expand All @@ -5658,6 +5658,7 @@ exports[`html "select" supports additional select attributes 1`] = `
readOnly={true}
ref={null}
required={true}
value="value"
/>
`;

Expand Down
9 changes: 3 additions & 6 deletions packages/react-strict-dom/tests/html-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,7 @@ describe('html', () => {
let root;
act(() => {
root = create(
<html.option
defaultValue="defaultValue"
disabled={true}
label="label"
value="value"
/>
<html.option disabled={true} label="label" value="value" />
);
});
expect(root.toJSON()).toMatchSnapshot();
Expand All @@ -367,6 +362,7 @@ describe('html', () => {
act(() => {
root = create(
<html.select
defaultValue="defaultValue"
disabled={true}
name="user-language"
onBeforeInput={function onBeforeInput() {}}
Expand All @@ -377,6 +373,7 @@ describe('html', () => {
onSelectionChange={function onSelectionChange() {}}
readOnly={true}
required={true}
value="value"
/>
);
});
Expand Down