Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IME goes over the focused TextField #59

Open
TepesLucian opened this issue Aug 12, 2022 · 0 comments
Open

IME goes over the focused TextField #59

TepesLucian opened this issue Aug 12, 2022 · 0 comments

Comments

@TepesLucian
Copy link

I've played around with the sample app and there's an issue if you enable edge to edge with the keyboard. It scrolls the Column but not enough to keep it in view. Sample code:

class MainActivity: ComponentActivity() {
	override fun onCreate(savedInstanceState: Bundle?) {
		super.onCreate(savedInstanceState)
		WindowCompat.setDecorFitsSystemWindows(window, false)
		setContent {
			CollapsingToolbarTheme { MainScreen() }
		}
	}
}

@Composable
fun MainScreen() {
	CollapsingToolbarScaffold(
		modifier = Modifier
			.statusBarsPadding()
			.imePadding()
			.fillMaxSize(),
		state = rememberCollapsingToolbarScaffoldState(),
		scrollStrategy = ScrollStrategy.EnterAlwaysCollapsed,
		toolbar = {
			TopAppBar(
				title = { Text(text = "Title") },
				modifier = Modifier.height(56.dp),
			)
		}
	) {
		Column(
			modifier = Modifier
				.fillMaxWidth()
				.verticalScroll(rememberScrollState())
				.navigationBarsPadding(),
		) {
			repeat(100) {
				TextField(
					value = "Item $it",
					onValueChange = {},
					modifier = Modifier.padding(8.dp)
				)
			}
		}
	}
}

I'm sure it has to do with the body offset when toolbar is expanded. LazyColumn is worse, losing the focus when keyboard is showing (that's for sure a compose issue). Any thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant