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

fix: 🐛 data attributes without value outputting as "true"
pull/7738/head
Rich Harris 6 years ago committed by GitHub
commit ee9045f08c

@ -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