Closed qingyingwu closed 4 months ago
As a workaround, you can use icon=""
on the custom-element or to use the React wrapper with one of the suggested boolean attribute gotcha workarounds (see updated repro case).
This is a known issue with React and booleans. In this case, the mixed boolean + string type adds another layer to this gotcha. When using a boolean attribute, the React wrapper handles it properly, but when using the custom element directly (i.e., not the wrapper), React will set icon="true"
, which the component will then use as the icon name. You can see this in the console:
We recommend using the wrapper for React use cases, so not sure if adding a note about this to the doc is appropriate. cc @benelan @geospatialem
Closing based on the above.
cc @geospatialem, @brittneytewks
Check existing issues
Actual Behavior
Using ArcGIS Velocity, sometimes the calcite-notice doesn't show the icon when
icon
sets to true as the screenshot shown below:As an experiment, adding another calcite-notice by providing an icon name, the icon shows correctly:
the code used for the screenshot above:
In ArcGIS Velocity, the issue was not always reproducible. At some places, the calcite-notice shows the icon consistently, and at some other places most of the time it doesn't show the icon. The link below contains testing details: https://devtopia.esri.com/WebGIS/arcgis-velocity-online/issues/15021#issuecomment-4822238
Expected Behavior
calcite-notice should display the icon correctly.
Reproduction Sample
repro sample
Reproduction Steps
icon
to true.The reproduction sample shows that calcite-notice doesn't show the icon consistently when setting icon to true.
Reproduction Version
2.9.0
Relevant Info
No response
Regression?
No response
Priority impact
impact - p3 - not time sensitive
Impact
Minor impact that slightly degrades user experience
Calcite package
Esri team
ArcGIS Velocity