Skip to content

Commit 537beea

Browse files
committed
Address lookup fixed initialization.
1 parent 2317cd3 commit 537beea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/gwt/material/design/incubator/client/google/addresslookup/AddressLookup.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020
package gwt.material.design.incubator.client.google.addresslookup;
2121

22+
import com.google.gwt.core.client.Scheduler;
2223
import com.google.gwt.event.shared.HandlerRegistration;
2324
import gwt.material.design.client.constants.Autocomplete;
2425
import gwt.material.design.client.ui.MaterialTextBox;
@@ -83,6 +84,7 @@ public class AddressLookup extends MaterialTextBox
8384
public AddressLookup() {
8485
setPlaceholder("");
8586
setAutocomplete(Autocomplete.OFF);
87+
addStyleName("address-lookup");
8688
}
8789

8890
/**
@@ -102,8 +104,10 @@ protected void onLoad() {
102104
}
103105

104106
public void load() {
105-
addressLookup = new JsAddressLookup(valueBoxBase.getElement(), options);
106-
addressLookup.addListener(AddressLookupEvents.PLACE_CHANGED, () -> PlaceChangedEvent.fire(AddressLookup.this));
107+
Scheduler.get().scheduleDeferred(() -> {
108+
addressLookup = new JsAddressLookup(valueBoxBase.getElement(), options);
109+
addressLookup.addListener(AddressLookupEvents.PLACE_CHANGED, () -> PlaceChangedEvent.fire(AddressLookup.this));
110+
});
107111
}
108112

109113
/**

0 commit comments

Comments
 (0)