You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
michalpuskel
changed the title
attributesToProps converts attribute key with name "open" always to true
attributesToProps converts attribute with key name "open" always to value trueNov 10, 2023
@michalpuskel thanks for opening the issue! This is expected behavior as the open attribute is a boolean attribute so if the key exists, it will be considered true. See https://stackoverflow.com/a/15261366
Nevertheless, never mind because I had to hard code Dialog with opentrue anyway and show / hide it with JS + CSS because rerendering works (or doesn't) the other way in templates than in regular React...
Expected Behavior
value
open
should befalse
after attributesToProps conversionActual Behavior
keyword
open
for attribute name is hardcoded so that value is alwaystrue
Steps to Reproduce
convert object with attribute of name
open
with any falsy value (false
,undefined
,null
,""
)Reproducible Demo
https://codesandbox.io/s/adoring-waterfall-rcr5fm?file=/src/App.tsx
Environment
"html-react-parser": "^5.0.3",
Keywords
attributesToProps, React, MUI, open, always true, hardcoded, html-react-parser
The text was updated successfully, but these errors were encountered: