diff --git a/src/diff/props.js b/src/diff/props.js index d03492293a..316146f0fd 100644 --- a/src/diff/props.js +++ b/src/diff/props.js @@ -116,6 +116,7 @@ export function setProperty(dom, name, value, oldValue, namespace) { name != 'rowSpan' && name != 'colSpan' && name != 'role' && + name != 'popover' && name in dom ) { try { @@ -135,7 +136,7 @@ export function setProperty(dom, name, value, oldValue, namespace) { if (typeof value == 'function') { // never serialize functions as attribute values } else if (value != null && (value !== false || name[4] === '-')) { - dom.setAttribute(name, value); + dom.setAttribute(name, name == 'popover' && value == true ? '' : value); } else { dom.removeAttribute(name); } diff --git a/test/browser/render.test.js b/test/browser/render.test.js index a861271afe..f440962f70 100644 --- a/test/browser/render.test.js +++ b/test/browser/render.test.js @@ -472,6 +472,21 @@ describe('render()', () => { expect(scratch.firstChild.spellcheck).to.equal(false); }); + it('should support popover auto', () => { + render(
, scratch); + expect(scratch.innerHTML).to.equal(""); + }); + + it('should support popover true boolean', () => { + render(, scratch); + expect(scratch.innerHTML).to.equal(""); + }); + + it('should support popover false boolean', () => { + render(, scratch); + expect(scratch.innerHTML).to.equal(""); + }); + // Test for preactjs/preact#4340 it('should respect defaultValue in render', () => { scratch.innerHTML = '';