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

Fixed clearing errors #6656

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Mar 19, 2025

Closes #6508

Why is this the best possible solution? Were any other approaches considered?

It seems that Android might be retaining the error, possibly through the text field ID, and keeps it displayed after the view is recreated. To resolve this, we need to programmatically clear the error during the view creation process.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

It should just fix the issue but please make sure errors are displayed and cleared correctly in text questions.

Do we need any specific form for testing your changes? If so, please attach one.

The form from the issue.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 marked this pull request as ready for review March 19, 2025 21:34
@grzesiek2010 grzesiek2010 requested a review from seadowg March 19, 2025 21:34
@@ -166,7 +167,9 @@ class WidgetAnswerText(context: Context, attrs: AttributeSet?) : FrameLayout(con
}

fun setError(error: String?) {
binding.textInputLayout.error = error
binding.textInputLayout.post {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the post here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new scenario needs some delay to clear the error after recreating the view.

@grzesiek2010 grzesiek2010 requested a review from seadowg March 21, 2025 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants