From a5adc167ced34ea3e51a2457e61e59e17970e214 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Thu, 16 Nov 2023 03:20:56 +0800 Subject: [PATCH] refactor: no need propagate content color in DropdownMenuItem --- .../kotlin/com/highcapable/flexiui/component/DropdownMenu.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/DropdownMenu.kt b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/DropdownMenu.kt index a228b19..dccf0c8 100644 --- a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/DropdownMenu.kt +++ b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/component/DropdownMenu.kt @@ -177,7 +177,9 @@ fun DropdownMenuItem( style = currentStyle, verticalAlignment = Alignment.CenterVertically ) { - CompositionLocalProvider(LocalTextStyle provides LocalTextStyle.current.default(currentColor)) { + // Note: Since this is a popup menu, we don't want to propagate the content color. + // So here we use copy NOT default. + CompositionLocalProvider(LocalTextStyle provides LocalTextStyle.current.copy(color = currentColor)) { content() } }