Skip to content

Button's active css styling/animation is not the same with mobile and web #3622

Answered by chardskarth
chardskarth asked this question in Q&A
Discussion options

You must be logged in to vote

Oh, I found what's missing. Thanks to this stack overflow.

For some (magical) reason, adding ontouchstart event makes both button recognize the button's active state.

use dioxus::prelude::*;
use daisy_rsx::Button as DaisyButton;

#[component]
pub fn Button(text: String) -> Element {
    rsx! {
        button {
            class: "
                btn btn-outline my-2 mx-8 p-4
                bg-violet-500 hover:bg-violet-600",
                ontouchstart: |_| {},
                // focus:outline-none focus:ring focus:ring-violet-300
            "{text}"
        }

        DaisyButton {
            "{text}"
        }
    }
}

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@chardskarth
Comment options

Comment options

You must be logged in to vote
5 replies
@chardskarth
Comment options

@wheregmis
Comment options

@chardskarth
Comment options

@wheregmis
Comment options

@chardskarth
Comment options

Comment options

You must be logged in to vote
3 replies
@chardskarth
Comment options

@wheregmis
Comment options

@hahdsa
Comment options

Answer selected by chardskarth
Comment options

You must be logged in to vote
1 reply
@wheregmis
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants