You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Calls a function when the button is tapped.pubfnbutton<A:'static,F:Fn(&mutContext) -> A + 'static>(view:implView,f:F) -> implView{state(
|| false,move |hover, _| {
view.padding(Auto).background(rectangle().corner_radius(BUTTON_CORNER_RADIUS).color(BUTTON_BACKGROUND_COLOR),).tap(move |cx| f(cx)).hover(|_, inside| {println!("inside button: {}", inside);}).role(Role::Button)},)}
The error here is that padding (or any other modifier) wants to move out of view, which is captured by the closure passed to state.
I'm not quite sure how to deal with this. I've tried making Views Clone, but it seems to cause a big ripple.
The text was updated successfully, but these errors were encountered:
I'm trying to add state to
button
for hovering:The error here is that
padding
(or any other modifier) wants to move out ofview
, which is captured by the closure passed tostate
.I'm not quite sure how to deal with this. I've tried making
View
s Clone, but it seems to cause a big ripple.The text was updated successfully, but these errors were encountered: