https://kotlinlang.org logo
Title
r

Rohan Maity

01/24/2022, 8:33 AM
Hello, I wanted to know that how can I add
modals/dialog forms
compose web I added Bootstrap modal but it's loaded as different screen
h

hfhbd

01/24/2022, 1:06 PM
Did you try https://github.com/hfhbd/bootstrap-compose? The modal should work as expected.
r

Rohan Maity

01/24/2022, 1:17 PM
I was wrapping it manually in my project
But I see what I was missing
Seems like this library covers the case
I got to know about DomSideEffect which I was missing
h

hfhbd

01/24/2022, 1:21 PM
Yeah, like the "nomal" compose way, you control the modal with a mutableState<Boolean>, see https://github.com/hfhbd/bootstrap-compose/blob/main/showcase/src/jsMain/kotlin/app.softwork.bootstrapcompose.showcase/ModalView.kt
r

Rohan Maity

01/24/2022, 5:30 PM
helo @hfhbd where does the
Modal(gtmlDivElement)
from in your Component ?
r

Rohan Maity

01/24/2022, 5:33 PM
So
show
and
hide
functionality are taken care of by this JS adapter file right ?
h

hfhbd

01/24/2022, 5:33 PM
yes
r

Rohan Maity

01/24/2022, 5:34 PM
understood. I was doing it wrong way I will check your lib in my project 😄