a country field, after the default text "_" and before the disclosureif it `_` or `-`?
// exposed in the header. If that is exposed in the future, this method can beThis sentence has no ending.
AutofillAIEntityCountryItem* countryItem =
base::apple::ObjCCastStrict<AutofillAIEntityCountryItem>(item);
if (self.tableView.editing) {
countryItem.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
countryItem.editingAccessoryType =
UITableViewCellAccessoryDisclosureIndicator;
countryItem.selectionStyle = UITableViewCellSelectionStyleDefault;
} else {
countryItem.accessoryType = UITableViewCellAccessoryNone;
countryItem.editingAccessoryType = UITableViewCellAccessoryNone;
countryItem.selectionStyle = UITableViewCellSelectionStyleNone;
}
}Duplicated code, move this to a utility function.
bool isEmpty = countryItem.detailText.length <= 1;Optional nit: We could do a check that's a bit more robust, to make sure that if a single character is entered by the user, it's treated differently that the "empty" scenario.
```suggestion
BOOL isEmpty = (countryItem.detailText.length == 0) ||
[countryItem.detailText isEqualToString:@"-"];
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
a country field, after the default text "_" and before the disclosureif it `_` or `-`?
When country attribute is set to an empty string, the `GetInfo` returns "_".
// exposed in the header. If that is exposed in the future, this method can beThis sentence has no ending.
I was thinking about adding a note here to that later on when its parent class is updated to expose a private method. But then that is not likely to happen. So, I have removed this comment. Just leave the necessary comment about the functionality of this method.
AutofillAIEntityCountryItem* countryItem =
base::apple::ObjCCastStrict<AutofillAIEntityCountryItem>(item);
if (self.tableView.editing) {
countryItem.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
countryItem.editingAccessoryType =
UITableViewCellAccessoryDisclosureIndicator;
countryItem.selectionStyle = UITableViewCellSelectionStyleDefault;
} else {
countryItem.accessoryType = UITableViewCellAccessoryNone;
countryItem.editingAccessoryType = UITableViewCellAccessoryNone;
countryItem.selectionStyle = UITableViewCellSelectionStyleNone;
}
}Duplicated code, move this to a utility function.
Done.
Optional nit: We could do a check that's a bit more robust, to make sure that if a single character is entered by the user, it's treated differently that the "empty" scenario.
```suggestion
BOOL isEmpty = (countryItem.detailText.length == 0) ||
[countryItem.detailText isEqualToString:@"-"];
```
Users can not edit this field directly. They have to pick a country from a list of countries. No countries are shorter than 4 characters from scrolling through the countries from the list.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
a country field, after the default text "_" and before the disclosureLeo Zhaoif it `_` or `-`?
When country attribute is set to an empty string, the `GetInfo` returns "_".
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
bool isEmpty = countryItem.detailText.length <= 1;Leo ZhaoOptional nit: We could do a check that's a bit more robust, to make sure that if a single character is entered by the user, it's treated differently that the "empty" scenario.
```suggestion
BOOL isEmpty = (countryItem.detailText.length == 0) ||
[countryItem.detailText isEqualToString:@"-"];
```
Users can not edit this field directly. They have to pick a country from a list of countries. No countries are shorter than 4 characters from scrolling through the countries from the list.
Not in the country selector, but I think "United States" comes out as "US" in this string, for example. Anyway, not critical at the moment.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[iOS][Forms AI] Error state for country field
This CL adds error state to country field. Since "Add payment" does not
have country field, entity edit has to create an error state for
country field. In this case, The same red circle symbol is used for
a country field, after the default text "_" and before the disclosure
icon.
Screenshots:
https://screenshot.googleplex.com/6CCbg7VBtpearMF
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |