picker icon indicating copy to clipboard operation
picker copied to clipboard

How to change the ellipsize mode on iOS ?

Open zabojad opened this issue 2 years ago • 3 comments

I'd like to change the ellipsize mode to "clip" instead of "tail" on iOS, is that possible?

zabojad avatar Apr 04 '22 14:04 zabojad

mmm, that would be easily feasible by adding a ellipsizeMode prop on the Picker component and set it there:

label.numberOfLines = _numberOfLines;
label.lineBreakMode = NSLineBreakByClipping; // here, or any value exposed to js

label.leftInset = 20.0;
label.rightInset = 20.0;

return view;

zabojad avatar Apr 04 '22 15:04 zabojad

In my case, I want to set numberOfLines to 0. Except some js code from this lib is preventing it:

PickerIOS.ios.js#L99

    let numberOfLines = Math.round(this.props.numberOfLines ?? 1);
    if (numberOfLines < 1) {
      numberOfLines = 1;
    }

This is wrong, we should allow a value of 0 to deactivate text truncating. I'll issue a PR for that.

zabojad avatar Apr 07 '22 09:04 zabojad

The same problem, switched to the last version, and now 2022 looks like 20... we need a way to disable ellipsize if it needed

oleksiy-nesterov avatar Nov 20 '22 22:11 oleksiy-nesterov