Merge pull request #2804 from kaisermann/fix/dataset-without-value

fix: 🐛 data attributes without value outputting as "true"
pull/2808/head
Rich Harris 5 years ago committed by GitHub
commit 931c080517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -187,7 +187,7 @@ export default class AttributeWrapper {
: property_name
? `${element.var}.${property_name} = ${value};`
: is_dataset
? `${element.var}.dataset.${camel_case_name} = ${value};`
? `${element.var}.dataset.${camel_case_name} = ${value === true ? '""' : value};`
: `${method}(${element.var}, "${name}", ${value === true ? '""' : value});`
);

@ -0,0 +1,3 @@
export default {
html: '<div data-potato=""></div>',
};
Loading…
Cancel
Save