FloatLabelRow
FloatLabelRow copied to clipboard
textFieldDidChange does not update row value when generic type can't be initialized
Sorry if the title is unclear I don't really know how to summarize it better. Here's the bug: when a row is modified, textFieldDidChange constructs a new object of the appropriate type from the underlying string input. Typically this is a new string, so it works. The new value is then assigned to row.value which triggers formRow.onChange
If the data type is a URL (URLFloatLabelCell) and the string input is invalid for a URL, init will fail and the existing row.value will be assigned back to itself. This is a problem for two reasons:
- the user enters text that does not match the actual data
- onChange is not called so it is not possible to validate the input
I did not test it, but I suspect a similar failure will occur with the Decimal, Int, and Float variants.