Skip to content

feat(VAlert): add duration prop for auto-dismissal#22952

Closed
sridhar-3009 wants to merge 5 commits into
vuetifyjs:masterfrom
sridhar-3009:feat/alert-duration-prop-20409
Closed

feat(VAlert): add duration prop for auto-dismissal#22952
sridhar-3009 wants to merge 5 commits into
vuetifyjs:masterfrom
sridhar-3009:feat/alert-duration-prop-20409

Conversation

@sridhar-3009

Copy link
Copy Markdown
Contributor

Fixes #20409

Adds a duration prop to v-alert that automatically dismisses the alert after the specified number of milliseconds (default: -1 = disabled).

The timer is cleaned up on component destroy and restarts if duration or modelValue changes.

@J-Sek J-Sek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to rename as timeout and extract reusable composable that can be aslo used for VSnackbar?

…osable

- Rename duration prop to timeout to match VSnackbar naming
- Extract reusable useTimeout composable shared by VAlert and VSnackbar
- Rename example file from prop-duration to prop-timeout
@sridhar-3009

Copy link
Copy Markdown
Contributor Author

@J-Sek updated

@eldardada

Copy link
Copy Markdown

This one was earlier #22947

@sridhar-3009

Copy link
Copy Markdown
Contributor Author

Closing in favour of #22947 by @eldardada which was submitted earlier and has a more complete implementation (pause on hover/focus, WCAG 2.2.1, useAutoDismiss composable shared with VSnackbar).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add duration Prop to Automatically Dismiss v-alert

3 participants