Skip to content

Commit

Permalink
doc(live-component): fix doc about array values checkboxes data-model…
Browse files Browse the repository at this point in the history
… attribute
  • Loading branch information
welcoMattic committed May 30, 2023
1 parent 3673127 commit 5dbe5d5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/LiveComponent/assets/dist/live_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,6 @@ class ValueStore {
return this.pendingProps[normalizedName];
}
if (this.props[normalizedName] !== undefined) {
if (Array.isArray(this.props[normalizedName])) {
return [...this.props[normalizedName]];
}
return this.props[normalizedName];
}
return getDeepData(this.props, normalizedName);
Expand Down
3 changes: 0 additions & 3 deletions src/LiveComponent/assets/src/Component/ValueStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ export default class {
}

if (this.props[normalizedName] !== undefined) {
if (Array.isArray(this.props[normalizedName])) {
return [...this.props[normalizedName]];
}
return this.props[normalizedName];
}

Expand Down
6 changes: 3 additions & 3 deletions src/LiveComponent/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,9 @@ value on checked. If no ``value`` is set, the checkbox will set a boolean value:

<input type="checkbox" data-model="agreeToTerms">

<input type="checkbox" data-model="foods" value="pizza">
<input type="checkbox" data-model="foods" value="tacos">
<input type="checkbox" data-model="foods" value="sushi">
<input type="checkbox" data-model="foods[]" value="pizza">
<input type="checkbox" data-model="foods[]" value="tacos">
<input type="checkbox" data-model="foods[]" value="sushi">

``select`` and ``radio`` elements are a bit easier: use these to either set a
single value or an array of values::
Expand Down

0 comments on commit 5dbe5d5

Please sign in to comment.