I'm trying to use the `NavigationSuiteScaffold` an...
# compose
p
I'm trying to use the
NavigationSuiteScaffold
and I cannot seem to handle the bottom tabs correctly for ime padding. If I take a look at the implementation it seems like it is consuming the inset:
Copy code
Modifier.consumeWindowInsets(
                        when (layoutType) {
                            NavigationSuiteType.NavigationBar ->
                                NavigationBarDefaults.windowInsets.only(WindowInsetsSides.Bottom)
But I end up with something like this (attachment) if I use
Modifier.imePadding()
. The extra padding seems to match perfectly the amount that should be consumed by the tab bar. When I use the non-adaptive Scaffold for my tab bar I am given a padding value that I can consume manually to avoid this issue (I have found lots of discussion around doing that), but I don't get such a padding for the adaptive version. If I manually add a
consumeWindowInsets(100.dp)
inside of the content of the
NavigationSuiteScaffold
it seems to "work" so it seems like the
NavigationBarDefaults.windowInsets
is not correct. I can't find an existing issue though and I have to imagine I wouldn't be the first person to try and use a keyboard with the adaptive scaffold so I am wondering if I'm doing something wrong on my end.
a
A new tool being added in Compose 1.8 is
Modifier.recalculateWindowInsets
, which should help give an out to some of these sticky situations when the communication doesn’t happen perfectly. I do think this is a bug though - the
NavigationSuiteScaffold
should be consuming from the insets the amount of space that the navigation UI itself takes up
p
Oh okay, that is comforting. I thought I was following all of the examples and tutorials I could find. Is there somewhere I should report this? Luckily it is not super urgent for us since this is not production code
a
Yes, if you can report it to the main Compose issue tracker that'd be great!
p
Will do! Trying to create a standalone repro first since our app is (sadly) closed source