Variable: HandleElementCSSBoxFeature
• Const
HandleElementCSSBoxFeature: FeatureClass<HandleElementCSSBoxDimensionsOptions, { onDOMElementCSSBoxDimensions: PropDefinition<"onDOMElementCSSBoxDimensions", (e: ElementCSSBoxDimensions) => void> }>
This feature provides onDOMElementCSSBoxDimensions
prop with payloads of type ElementCSSBoxDimensions.
The payload contains information about the CSS Box dimensions of an element in the
WebView
pixels unit (see HandleElementCSSBoxDimensionsOptions to instruct which element should be targeted).
example
const Webshell = makeWebshell(
WebView,
new HandleElementCSSBoxDimensionsOptions({
target: { id: "sidebar" }
})
);
export function MyComponent(props) {
const onSidebarDimensions = ({ borderBox }) => console.info(borderBox.width)
return <Webshell {...props} onDOMElementCSSBoxDimensions={onSidebarDimensions} />
}
remarks
A new event will be triggered on every resize.
If you are looking for the document content size, use HandleHTMLDimensionsFeature instead.