12 Jan 2024 |
kirillsemyonkin | i didnt understand really kek if you are still talking about overflow:hidden, i would do it from ModalProvider/ModalHandle | 21:39:44 |
dementeddddd | how do i set that on body from there tho | 21:40:14 |
dementeddddd | it would be perfect to do it from the show and hide functions | 21:41:51 |
kirillsemyonkin | for the second solution, inside ModalProvider , you just add a
let css = css! {
body {
overflow: ${if *visible { "hidden" } else { "initial" }};
}
};
<Global { css } />
for the first solution, inside show /hide , you would do something like
use gloo_utils::body;
body().style().set_property("overflow", ...).unwrap(); | 21:44:22 |
kirillsemyonkin | * for the second solution, inside ModalProvider , you just add a
let css = css! {
body {
overflow: ${if *visible { "hidden" } else { "initial" }};
}
};
... // anywhere inside html!
<Global { css } />
...
for the first solution, inside show /hide , you would do something like
use gloo_utils::body;
body().style().set_property("overflow", ...).unwrap(); | 21:44:59 |
dementeddddd | oh yea i can just place css anywhere | 21:46:59 |
dementeddddd | imma go with the 2nd one | 21:48:07 |
kirillsemyonkin | for 2nd one you might need web_sys also | 21:48:12 |
kirillsemyonkin | with some features turned on | 21:48:21 |
kirillsemyonkin | for first one the feature is "yew" i think | 21:48:29 |
kirillsemyonkin | Redacted or Malformed Event | 21:48:33 |
kirillsemyonkin | Redacted or Malformed Event | 21:48:35 |
kirillsemyonkin | Redacted or Malformed Event | 21:48:38 |
kirillsemyonkin | Redacted or Malformed Event | 21:48:39 |
kirillsemyonkin | * for body().style() one you might need web_sys also | 21:48:58 |
dementeddddd | yes it worked | 21:54:20 |
dementeddddd | cant scroll now | 21:54:25 |
dementeddddd | do i add an on_click to the .modal now for exiting | 21:55:16 |
dementeddddd | and a key press maybe | 21:55:22 |
dementeddddd | however that works | 21:55:27 |
kirillsemyonkin | for global key events i wrote about it https://discord.com/channels/701068342760570933/1164567450692628610/1164655541671440434 | 22:01:21 |
kirillsemyonkin | however there might be more checks needed, for example no input probably should be in focus | 22:01:45 |
kirillsemyonkin | click outside to close i showed here | 22:04:59 |
dementeddddd | alr thanks ill look more into t hat stuff tmrw, thanks for the help :) | 22:05:39 |
| innominus changed their display name from innominus#0 to innominus. | 22:22:56 |
19 Jan 2024 |
| A2 joined the room. | 14:28:34 |
24 Jan 2024 |
| tobin6579 joined the room. | 06:46:03 |
31 Jan 2024 |
A2 | Is there any way to make a whole component be async?
I'm doing the spawn_local thing all over the place right now, and it's becoming a bit inconvenient.
My dream would be able to something like
#[async_function_component(MyPage)]
async fn my_page(props: &Props) {
...
}
but it looks like that's not something supported by yew | 13:49:07 |
| @aziz6004:matrix.org joined the room. | 22:20:38 |
@aziz6004:matrix.org | Redacted or Malformed Event | 22:20:40 |