Skip to content

Commit 14b3900

Browse files
authored
Add Material 3 NavigationBar and NavigationBarItem as content emitters (#632)
Add Material 3 `NavigationBar` and `NavigationBarItem` to `ComposableEmittersList`. These are the Material 3 equivalents of `NavigationRail` / `NavigationRailItem` (already listed in the Material 2 section) and the Material 2 `BottomNavigation` (already listed in the Accompanist section). Mirrors the shape of #613, which added the Material 3 dividers. Without these entries, `MultipleContentEmitters` and `ModifierNotUsedAtRoot` rely on the `containsComposablesWithModifiers()` fallback in `KtCallExpression.emitsContent` — which only matches when the call site passes a `modifier` argument. Calls like `NavigationBar { … }` (no explicit modifier forwarded) currently slip through. Adding the names to the emitters list closes that gap.
1 parent 6aaf4fc commit 14b3900

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • rules/common/src/main/kotlin/io/nlopez/compose/core/util

rules/common/src/main/kotlin/io/nlopez/compose/core/util/Composables.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ private val ComposableEmittersList by lazy {
304304
"HorizontalDivider",
305305
"InputField",
306306
"ModalBottomSheet",
307+
"NavigationBar",
308+
"NavigationBarItem",
307309
"PlainTooltip",
308310
"RichTooltip",
309311
"SearchBar",

0 commit comments

Comments
 (0)