Skip to content

Commit 629584d

Browse files
committed
use string keypath, not sourcemappable snippet, for determining binding groups — fixes #498
1 parent 0dac01c commit 629584d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/generators/dom/visitors/Element/Binding.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import getSetter from '../shared/binding/getSetter.js';
44
import getStaticAttributeValue from './getStaticAttributeValue.js';
55

66
export default function visitBinding ( generator, block, state, node, attribute ) {
7-
const { name, keypath } = flattenReference( attribute.value );
7+
const { name, keypath, parts } = flattenReference( attribute.value );
88
const { snippet, contexts, dependencies } = block.contextualise( attribute.value );
99

1010
if ( dependencies.length > 1 ) throw new Error( 'An unexpected situation arose. Please raise an issue at https://github.com/sveltejs/svelte/issues — thanks!' );
@@ -17,7 +17,7 @@ export default function visitBinding ( generator, block, state, node, attribute
1717
const handler = block.getUniqueName( `${state.parentNode}_${eventName}_handler` );
1818
const isMultipleSelect = node.name === 'select' && node.attributes.find( attr => attr.name.toLowerCase() === 'multiple' ); // TODO use getStaticAttributeValue
1919
const type = getStaticAttributeValue( node, 'type' );
20-
const bindingGroup = attribute.name === 'group' ? getBindingGroup( generator, keypath ) : null;
20+
const bindingGroup = attribute.name === 'group' ? getBindingGroup( generator, parts.join( '.' ) ) : null;
2121
const value = getBindingValue( generator, block, state, node, attribute, isMultipleSelect, bindingGroup, type );
2222

2323
let setter = getSetter({ block, name, keypath, context: '_svelte', attribute, dependencies, value });

0 commit comments

Comments
 (0)