Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

button should have a confirm property to trigger confirm dialog #831

Open
setop opened this issue Feb 26, 2025 · 0 comments
Open

button should have a confirm property to trigger confirm dialog #831

setop opened this issue Feb 26, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@setop
Copy link
Contributor

setop commented Feb 26, 2025

a movie gallery (still)

What is your problem ?

The button component creates a clickable button that triggers an action. This action can be destructive, such as deleting or altering a record.

It would be beneficial to have a confirmation dialog appear when the button is clicked. If the user clicks "Confirm," the action will be performed; otherwise, the confirmation dialog will close, and the user will remain on the current page.

This feature would help prevent accidental deletions.

What are you currently doing ?

Living in fear :)

Describe the solution you'd like

Have additional optional properties for the component:

  • "confirm" a bolean ; enable confirm dialog when set to true ; default to false (for backward compatibility)
  • "confirm_text" a text ; message displayed in the confirmation dialog; defaults to "are you sure you want to proceed ?"
select
   'button' as component
;
select
      '/delete_item.sql?id=' || id as link
    , 'trash' as icon
    , 'danger' as color
    , 'Delete' as title
    , true as confirm
    , 'You are about  to delete item "' || title  || '". please confirm' as confirm_text
;

Image

Describe alternatives you've considered

None

@setop setop added the enhancement New feature or request label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant