-
Description Any HTML data attribute, including Steps Add any custom Expectation When the Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
To include a custom data attribute in the rendered HTML element generated by the Plate React component, you can use the editableProps property. Here is an example of how you can achieve this: const Editor = () => {
const editableProps = {
'data-testid': 'plate-textbox',
// other editable props...
};
return (
<Plate editableProps={editableProps} />
);
}; |
Beta Was this translation helpful? Give feedback.
-
I see. Thanks for the info. But I'm using TS, so it has type error as it doesn't exist in TS2322 |
Beta Was this translation helpful? Give feedback.
Just tested in
plate-template
, it works well:See env here: https://github.com/udecode/plate/tree/aa6538b4fdc7ce546759165f837de1e4777c76f2/templates/plate-template.