meliorence / react-native-render-html

iOS/Android pure javascript react-native component that renders your HTML into 100% native views
https://meliorence.github.io/react-native-render-html/
BSD 2-Clause "Simplified" License
3.48k stars 589 forks source link

The "input" tag is a valid HTML element but is not handled by this library. #538

Closed VitaliyGaliy closed 2 years ago

VitaliyGaliy commented 2 years ago

Decision Table

Good Faith Declaration

Description

Can not use an input HTML element.

React Native Information

"expo": "~43.0.0",
 "react-native": "0.64.2",

RNRH Version

0.64.2

Tested Platforms

Reproduction Platforms

Minimal, Reproducible Example

` const source = { html:

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quo minima quis accusamus rerum dolorum!

};

const customHTMLElementModels = { 'input': HTMLElementModel.fromCustomModel({ tagName: 'input', mixedUAStyles: { width: 50, height: 10, backgroundColor: 'blue' }, contentModel: HTMLContentModel.block }), };

const App = () => {

const { width } = useWindowDimensions(); return ( <RenderHtml contentWidth={width} source={source} customHTMLElementModels={customHTMLElementModels} /> ); }; `

Additional Notes

No response

jsamr commented 2 years ago

@VitaliyGaliy Thanks for the report! The default content model for input is "none", because interactive elements are not handled by default. You need to provide an element model with block content model; I agree this could be documented in the FAQ!