diff --git a/app/src/main/java/helium314/keyboard/settings/screens/SubtypeScreen.kt b/app/src/main/java/helium314/keyboard/settings/screens/SubtypeScreen.kt index 4a96d73f..6dd6cbef 100644 --- a/app/src/main/java/helium314/keyboard/settings/screens/SubtypeScreen.kt +++ b/app/src/main/java/helium314/keyboard/settings/screens/SubtypeScreen.kt @@ -412,10 +412,11 @@ private fun MainLayoutRow( initialLayoutName = layoutName, startContent = startContent, locale = currentSubtype.locale, - // only can edit name for new custom layout - isNameValid = if (layoutName in customLayouts) null else ({ it !in customLayouts }), + isNameValid = { it !in customLayouts }, onEdited = { - if (layoutName !in customLayouts) + if (layoutName !in customLayouts // edited a built-in layout, set new one as current + || layoutName != it && layoutName == currentSubtype.mainLayoutName() // layout name for current subtype changed + ) setCurrentSubtype(currentSubtype.withLayout(LayoutType.MAIN, it)) } )