mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-19 22:05:07 +00:00
fix phone number country code on address form (#130)
This commit is contained in:
parent
3aec5f6692
commit
f43e8a0ec6
2 changed files with 5 additions and 5 deletions
|
|
@ -55,11 +55,11 @@ Element.prototype.attachShadow = function(init) {
|
|||
return originalAttachShadow.call(this, init);
|
||||
};
|
||||
|
||||
function createAddressAutocomplete() {
|
||||
function createAddressAutocomplete(initialData = {}) {
|
||||
return {
|
||||
callingCodes: {},
|
||||
callingCode: '1',
|
||||
selectedCountry: 'US',
|
||||
callingCodes: initialData.callingCodes || {},
|
||||
callingCode: initialData.callingCode || '1',
|
||||
selectedCountry: initialData.selectedCountry || 'US',
|
||||
|
||||
init() {
|
||||
if (window.googleMapsReady) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
form_html_attrs = {}
|
||||
end
|
||||
%>
|
||||
<%= form_with model: address, url: local_assigns[:url], local: true, html: form_html_attrs.merge("x-data": "addressAutocomplete", "@alpine:init": "Object.assign($data, { callingCodes: #{country_calling_codes.to_json}, callingCode: '#{initial_calling_code}', selectedCountry: '#{initial_country}' })") do |f| %>
|
||||
<%= form_with model: address, url: local_assigns[:url], local: true, html: form_html_attrs.merge("x-data": "addressAutocomplete(#{({ callingCodes: country_calling_codes, callingCode: initial_calling_code, selectedCountry: initial_country }).to_json})") do |f| %>
|
||||
<% if local_assigns[:from_program] %>
|
||||
<%= f.hidden_field :from_program, value: true %>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue