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

[TextInputLayout] setting endIconMode makes hint disappear #2573

Closed
ChekistNSK opened this issue Feb 22, 2022 · 11 comments
Closed

[TextInputLayout] setting endIconMode makes hint disappear #2573

ChekistNSK opened this issue Feb 22, 2022 · 11 comments

Comments

@ChekistNSK
Copy link

ChekistNSK commented Feb 22, 2022

Description: To display my custom icon correctly on the right side (app:endIconDrawable="@drawable/ic_drop_down") - it is necessary to specify app:endIconMode="custom". However, adding this parameter entails a situation where the text from android:hint= is not shown for some reason.

Expected behavior:
image

Source code:

<com.google.android.material.textfield.TextInputLayout
        android:layout_width="74dp"
        android:layout_height="wrap_content"
        app:endIconDrawable="@drawable/ic_drop_down"
        app:endIconMode="custom"
        app:endIconTint="@color/grey"
        app:expandedHintEnabled="false"
        app:hintAnimationEnabled="false"
        app:startIconDrawable="@drawable/ic_flag_loading"
        app:startIconTint="@null">
        <com.google.android.material.textfield.TextInputEditText
                android:clickable="false"
                android:cursorVisible="false"
                android:focusable="false"
                android:focusableInTouchMode="false"
                android:hint="Country"
                android:inputType="none" />
</com.google.android.material.textfield.TextInputLayout>

Android API version: 32

Material Library version: 1.4.0

Device: Redmi 9 (12.0.2) + emulator

@ChekistNSK ChekistNSK added the bug label Feb 22, 2022
@hunterstich
Copy link
Contributor

Hi @ChekistNSK,

Is this happening when you run the app or just in the Android Studio preview?

@ChekistNSK
Copy link
Author

ChekistNSK commented Feb 23, 2022

Is this happening when you run the app or just in the Android Studio preview?

Hi, @hunterstich
This happens for both of the cases you described

@hunterstich
Copy link
Contributor

Can you provide a sample that reproduces this? It seems to be working on my end when running our catalog app. Thanks!

@ChekistNSK
Copy link
Author

Can you provide a sample that reproduces this? It seems to be working on my end when running our catalog app. Thanks!

What do you mean by a sample? I attached a piece of code of an xml-file with which problems are observed. If this is not enough, then I will send you exactly what you need.

@hunterstich
Copy link
Contributor

Hey, thanks for the quick response!

No, the XML isn't enough to diagnose what might be happening. If you could send a full zip/repository of an Android project that we can run locally and see the problem, that would be preferred.

@ChekistNSK
Copy link
Author

Unfortunately, I can't send the source files of the entire project. One of these days I will try to create a new project and simulate the situation I described above.

@hunterstich
Copy link
Contributor

For the time being, can you send a screen recording of the issue running on a physical device?

@ChekistNSK
Copy link
Author

icon_dissapeared_hint_visible.mp4
icon_visible_hint_wont_shown.mp4

@ChekistNSK
Copy link
Author

Hey, thanks for the quick response!

No, the XML isn't enough to diagnose what might be happening. If you could send a full zip/repository of an Android project that we can run locally and see the problem, that would be preferred.

Done. Rep is here

@ChekistNSK
Copy link
Author

@hunterstich Hi :)

Please confirm the fact that you also reproduce the situation with this bug when running the code, the link to which I sent you above.

@drchen drchen self-assigned this Apr 13, 2022
@drchen
Copy link
Contributor

drchen commented May 2, 2022

Thanks for the sample app! I managed to reproduce it. A fix is on its way. : )

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

No branches or pull requests

3 participants