Eureka: Picker Row does not allow selection of first item when value is initially nil

Created on 14 Mar 2017  路  3Comments  路  Source: xmartlabs/Eureka

When row.value is initially nil, the only way to select the first value is to scroll off the first value and then back to it. The possible workarounds are putting a "Select" value as the first value, selecting the first value when the user selects the picker, or defaulting the value.

Most helpful comment

I worked around it by using onCellSelection.

row.onCellSelection() { result in
  if result.1.value == nil 
    result.1.value = result.1.options.first
  }
}

All 3 comments

I working on this. In temporary, you should define new custom pickerView with xib file. on top, add 1 button let user press done.
Handle custom logic to get first value on that

I worked around it by using onCellSelection.

row.onCellSelection() { result in
  if result.1.value == nil 
    result.1.value = result.1.options.first
  }
}

Looks like you found a solution 馃槃 . Closing this issue

Cheers

Was this page helpful?
0 / 5 - 0 ratings