Skip to content

Commit

Permalink
Change use_scroll RTL to signal
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielleHuisman committed Apr 7, 2024
1 parent 3558ae7 commit 771370d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/leptos/tests/visual/src/spec/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn Arrow() -> impl IntoView {
reference_ref,
floating_ref,
update,
rtl: None,
rtl: None::<bool>.into(),
});

let placement_update_scroll = update_scroll.clone();
Expand Down
2 changes: 1 addition & 1 deletion packages/leptos/tests/visual/src/spec/auto_placement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn AutoPlacement() -> impl IntoView {
reference_ref,
floating_ref,
update,
rtl: None,
rtl: None::<bool>.into(),
});

view! {
Expand Down
2 changes: 1 addition & 1 deletion packages/leptos/tests/visual/src/spec/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn Scroll() -> impl IntoView {
reference_ref,
floating_ref,
update,
rtl: None,
rtl: None::<bool>.into(),
});

let reference_view = move || {
Expand Down
2 changes: 1 addition & 1 deletion packages/leptos/tests/visual/src/spec/shift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub fn Shift() -> impl IntoView {
reference_ref,
floating_ref,
update,
rtl: None,
rtl: None::<bool>.into(),
});

view! {
Expand Down
3 changes: 1 addition & 2 deletions packages/leptos/tests/visual/src/spec/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ pub fn Size() -> impl IntoView {
reference_ref,
floating_ref,
update,
// TODO: reactive?
rtl: Some(rtl()),
rtl: rtl.into(),
});

view! {
Expand Down
4 changes: 2 additions & 2 deletions packages/leptos/tests/visual/src/utils/use_scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct UseScrollOptions {
pub reference_ref: NodeRef<Div>,
pub floating_ref: NodeRef<Div>,
pub update: Rc<dyn Fn()>,
pub rtl: Option<bool>,
pub rtl: MaybeProp<bool>,
}

pub struct UseScrollReturn {
Expand Down Expand Up @@ -103,7 +103,7 @@ pub fn use_scroll(
let y = scroll.scroll_height() / 2 - scroll.offset_height() / 2;
log::info!("x {x} | y {y}");
scroll.set_scroll_top(y);
scroll.set_scroll_left(match rtl {
scroll.set_scroll_left(match rtl() {
Some(true) => -x,
_ => x,
})
Expand Down

0 comments on commit 771370d

Please sign in to comment.