Skip to content

Commit faa8a12

Browse files
committed
replace property.type with property.bidirectional
1 parent df368be commit faa8a12

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2743,7 +2743,7 @@ export const template_visitors = {
27432743
'$.bind_property',
27442744
b.literal(node.name),
27452745
b.literal(property.event),
2746-
b.literal(property.type ?? 'get'),
2746+
b.literal(property.bidirectional ? 'set' : 'get'),
27472747
state.node,
27482748
getter,
27492749
setter

packages/svelte/src/compiler/phases/bindings.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @typedef BindingProperty
33
* @property {string} [event] This is set if the binding corresponds to the property name on the dom element it's bound to
44
* and there's an event that notifies of a change to that property
5-
* @property {string} [type] Set this to `set` if updates are written to the dom property
5+
* @property {boolean} [bidirectional] Set this to `true` if updates are written to the dom property
66
* @property {boolean} [omit_in_ssr] Set this to true if the binding should not be included in SSR
77
* @property {string[]} [valid_elements] If this is set, the binding is only valid on the given elements
88
* @property {string[]} [invalid_elements] If this is set, the binding is invalid on the given elements
@@ -166,7 +166,7 @@ export const binding_properties = {
166166
// checkbox/radio
167167
indeterminate: {
168168
event: 'change',
169-
type: 'set',
169+
bidirectional: true,
170170
valid_elements: ['input'],
171171
omit_in_ssr: true // no corresponding attribute
172172
},
@@ -191,7 +191,7 @@ export const binding_properties = {
191191
},
192192
open: {
193193
event: 'toggle',
194-
type: 'set',
194+
bidirectional: true,
195195
valid_elements: ['details']
196196
},
197197
value: {

0 commit comments

Comments
 (0)