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
Just click on the blue button, notice the growl message and the console log error.
Current behavior
Even though the detail property of Growl is defined as type element, it is not possible to include <p> tags in the element without generating console errors. This appears to be because the Growl component wraps the supplied detail in a <p> itself. Growl should not assume detail can be wrapped in anything but a <div> safely.
Expected behavior
The growl message should render without generating a console log error.
Minimal reproduction of the problem with instructions
Ask a Growl component to show {severity: 'info', detail: <p>Oops</p>}. Note the error that appears in the DOM: Warning: validateDOMNesting(...): <p> cannot appear as a descendant of <p>..
If you inspect the DOM at this point you will see that the growl has wrapped the detail element in a <p>.
Please tell us about your environment:
macOS 10.14.5
React version:
16.8.6
PrimeReact version:
3.1.7
Browser:
all
Language:
Typescript
The text was updated successfully, but these errors were encountered:
If you wish to wrap plain text in a <p>, then you should probably first test this.props.message.detail to see if it is not a JSX element, and only if it is not go ahead and wrap in <p>, otherwise wrap in <div>.
mertsincan
added
Type: Bug
Issue contains a defect related to a specific component.
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
and removed
Type: Bug
Issue contains a defect related to a specific component.
labels
Jul 22, 2019
I'm submitting a ...
Codesandbox Case (Bug Reports)
https://codesandbox.io/s/primereact-growltest-7zkdf
Just click on the blue button, notice the growl message and the console log error.
Current behavior
Even though the
detail
property ofGrowl
is defined as typeelement
, it is not possible to include<p>
tags in the element without generating console errors. This appears to be because the Growl component wraps the supplieddetail
in a<p>
itself. Growl should not assumedetail
can be wrapped in anything but a<div>
safely.Expected behavior
The growl message should render without generating a console log error.
Minimal reproduction of the problem with instructions
Ask a
Growl
component to show{severity: 'info', detail: <p>Oops</p>}
. Note the error that appears in the DOM:Warning: validateDOMNesting(...): <p> cannot appear as a descendant of <p>.
.If you inspect the DOM at this point you will see that the growl has wrapped the detail element in a
<p>
.Please tell us about your environment:
macOS 10.14.5
16.8.6
3.1.7
all
Typescript
The text was updated successfully, but these errors were encountered: