Closed mpayson closed 1 year ago
Tangential to the issue encountered here, but this prompted the thought - should we have a single, recommended duration length (current “medium” or otherwise)?
Cc @SkyeSeitz @ashetland
Tangential to the issue encountered here, but this prompted the thought - should we have a single, recommended duration length (current “medium” or otherwise)?
Cc @SkyeSeitz @ashetland
I like this idea for consistency. The current short
duration is very fast.
@mpayson Could you share a repro case or snippet using the custom-elements
build?
Added additional context from #6824, there's also a workaround: https://codesandbox.io/s/calcitealert-autoclose-forked-r2zc46?file=/src/App.js
Research will be conducted in the upcoming June milestone for next steps.
I don't think we should be doing the following:
@Prop({ reflect: true }) autoCloseDuration: AlertDuration = this.autoClose ? "medium" : null;
If autoClose is initially false then this default autoCloseDuration won't be set. We should probably prohibit this pattern.
I'll open a PR to remove this logic and just have it set to "medium" by default.
Installed and assigned for verification.
Verified in 1.5.0-next.5
.
Actual Behavior
When using the dist build, an auto-closing calcite-alert will work when just the auto-close attribute is set.
When using the custom elements build,
calcite-alert
needs both theauto-close
andauto-close-duration
attributes to be set, otherwise thealert
will immediately dismiss and not display to the user.Expected Behavior
auto-close-duration
is not required (or is required) for both distributions and this is documentedReproduction Sample
~https://codepen.io/mpayson/pen/zYLaELw~ https://codesandbox.io/s/cc-bug-calcitealert-autoclose-autocloseduration-9ht5xd?file=/src/App.js
Reproduction Steps
The codepen uses the dist build, and it looks like the
auto-close-duration
property is automatically set on the element, despite it not being set in the markupalert
doesn't open on loadautoCloseDuration={"medium"}
toalert
alert
now loads withautoClose
-27 at 10 58 23 AM
In a project that uses the custom-elements build, I used the same markup with different results
Reproduction Version
1.0.3 (repro is in 1.2.0)
Relevant Info
custom-elements build
Regression?
No response
Impact
Seems low with the workaround, but should be mitigated as its not a great bug.
Esri team
ArcGIS Online