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

Improve scrolling to prevent overlap with save button #3642

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dhis2.usescases.teidashboard

import android.annotation.SuppressLint
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import dhis2.org.analytics.charts.data.ChartType
Expand Down Expand Up @@ -226,6 +227,7 @@ class TeiDashboardTest : BaseTest() {
}
}

@SuppressLint("IgnoreWithoutReason")
@Ignore
@Test
fun shouldOpenEventEditAndSaveSuccessfully() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.TextFieldValue
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.dhis2.commons.resources.ResourceManager
import org.dhis2.form.extensions.autocompleteList
Expand Down Expand Up @@ -79,14 +80,16 @@ fun FieldProvider(
.onSizeChanged { intSize ->
visibleArea = Rect(
size = Size(intSize.width.toFloat(), intSize.height.toFloat()),
offset = Offset(0f, 20f),
offset = Offset(0f, 200f),
)
}
.onFocusChanged {
if (it.isFocused && !fieldUiModel.focused) {
scope.launch {
bringIntoViewRequester.bringIntoView(visibleArea)
fieldUiModel.onItemClick()

delay(10)
andresmr marked this conversation as resolved.
Show resolved Hide resolved
bringIntoViewRequester.bringIntoView(visibleArea)
}
}
}
Expand Down
Loading