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

TrailingAccessory in Picker causes incorrect rendering on Picker.Item with a long text #2900

Open
2 of 7 tasks
Relax594 opened this issue Jan 16, 2024 · 0 comments
Open
2 of 7 tasks
Labels
bug a bug in one of the components

Comments

@Relax594
Copy link

Relax594 commented Jan 16, 2024

Description

Picker Component is truncating the Item Label too late when having a trailingAccessory assigned.
If I remove the trailingAccessory, it is working fine. Both Picker stop at 100% width of the container.
But when using a trailingAccessory, it gets pushed out of the container as seen on the screenshot below.

Only on Android, iOS is working fine.

Related to

  • Components
  • Demo
  • Docs
  • Typings

Steps to reproduce

Add two Picker Components with a trailingAccessory each.
Add Picker.Item with short texts to one Picker and add longer texts, which are wider than the screen width, to the other one.

Expected behavior

Item text on the long item gets truncated to fit the screen size including the trailingAccessory and match styling of the Picker with a short text.

Actual behavior

Item text gets truncated at screen size ignoring the width of the trailingAccessory making the trailingAccessory overlap out of the Picker container.

More Info

Code snippet

const produkte = {
    A: 'PensionsRente Komfort BASIC (mehr garantierte Rente, aber niedrige Kapitalmarktchance)',
    B: 'PensionsRente Komfort BALANCE (mittlere garantierte Rente und mittlere Kapitalmarktchance)',
    C: 'PensionsRente Komfort CHANCE (weniger garantierte Rente, aber hohe Kapitalmarktchance)',
};

<Picker
      trailingAccessory={<Text>&nbsp;€&nbsp;</Text>}
>
            {Object.keys(produkte).map(key => (
                   <Picker.Item
                          key={key}
                          label={produkte[key]}
                          value={key}
                     />
             ))}
</Picker>

Screenshots/Video

grafik

Environment

  • React Native version: 0.71.15
  • React Native UI Lib version: 7.15.0

Affected platforms

  • Android
  • iOS
  • Web
@Relax594 Relax594 added the bug a bug in one of the components label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in one of the components
Projects
None yet
Development

No branches or pull requests

1 participant