Closed krmax44 closed 2 years ago
It seems that Firefox returns false for all style attributes of DOM elements, causing style attributes to be missing.
Example:
const el = document.createElement('div') console.log(Object.prototype.hasOwnProperty.call(el.style, 'width')) // Chrome: true, Firefox: false
https://github.com/Lusito/tsx-dom/blob/5c69c12882c3797d1d4d2f51f6de341b69912190/src/index.ts#L26
Therefore, no style on Firefox. I'd suggest optimistically copying all attributes to target.style no matter what. Shouldn't break anything, if the property doesn't exist.
style
target.style
Thanks for the report and the PR. I changed it a bit, but left you as co-author.
Version 1.4.0 has just been released
It seems that Firefox returns false for all style attributes of DOM elements, causing style attributes to be missing.
Example:
https://github.com/Lusito/tsx-dom/blob/5c69c12882c3797d1d4d2f51f6de341b69912190/src/index.ts#L26
Therefore, no
style
on Firefox. I'd suggest optimistically copying all attributes totarget.style
no matter what. Shouldn't break anything, if the property doesn't exist.