You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the region value is passed from the model field to the form field, but it is not used after that. I wanted to make it so that the region value I added in the model field could be also used in the PhoneNumberPrefixWidget as the default region selected, so for example the customer would see their own country selected by default but then they could select another country for international numbers. Would this be an okay addition? Seems like this would simply entail setting self.widget.region = region in the formfield constructor. Alternatively we could pass it as part of the attrs dict, but that would require a custom BoundField subclass as sadly formfields cannot directly influence widget attrs.
I can create a PR if this is acceptable.
The text was updated successfully, but these errors were encountered:
That looks like a usability improvement, thanks for the suggestion! 👍
I see that the form field already passes the region to widgets that support it. It looks like RegionalPhoneNumberWidget relies on it, so the change will likely be quite small.
Currently, the
region
value is passed from the model field to the form field, but it is not used after that. I wanted to make it so that theregion
value I added in the model field could be also used in thePhoneNumberPrefixWidget
as the default region selected, so for example the customer would see their own country selected by default but then they could select another country for international numbers. Would this be an okay addition? Seems like this would simply entail settingself.widget.region = region
in the formfield constructor. Alternatively we could pass it as part of theattrs
dict, but that would require a customBoundField
subclass as sadly formfields cannot directly influence widget attrs.I can create a PR if this is acceptable.
The text was updated successfully, but these errors were encountered: