plotly / dash-html-components

OBSOLETE - now part of https://github.com/plotly/dash
https://dash.plotly.com
Other
153 stars 49 forks source link

[BUG] html.ObjectEl does not accept the data keyword #161

Closed RiccardoNizzolo closed 3 years ago

RiccardoNizzolo commented 4 years ago

Hi, I'm using Dash with the following configuration:

dash-core-components==1.5.0
dash-html-components==1.0.1
dash-renderer==1.2.0

The issue is that html.ObjectEl() does not accept the data keyword but only a "data-*" wildcard

Indeed the following python code is raising an exception:

html.ObjectEl("your browser doesn’t support the object tag", data= "/a_link")

Exception:

TypeError: Unexpected keyword argument 'data'
Allowed arguments: accessKey, aria-*, children, className, contentEditable, contextMenu, data-*, dir, draggable, form, height, hidden, id, key, lang, loading_state, n_clicks, n_clicks_timestamp, name, role, spellCheck, style, tabIndex, title, type, useMap, width

Instead the expected behaviour should be the following HTML:

<object data="/a_link"> 
    Your browser doesn’t support the object tag. 
</object>

calling the constructor with the wildcard works, but the produced HTML is different from the expected one:

html.ObjectEl("your browser doesn’t support the object tag", **{'data-test': "/a_link"})

return the HTML:

<object data-test="/a_link"> 
    Your browser doesn’t support the object tag. 
</object>
alexcjohnson commented 4 years ago

Thanks @RiccardoNizzolo - moved to the dash-html-components repo. I guess either our attribute source is somehow missing data, or we erroneously filter it out because of its similarity to data-*

rpkyle commented 4 years ago

Related to/mentioned in https://github.com/plotly/dash-html-components/issues/129, and earlier in https://github.com/plotly/dash-html-components/issues/66.

alexcjohnson commented 4 years ago

Ah, and #129 points to #66 where this was reported ages ago 🙄 This issue has more info though, so I'll close #66