@@ -25,13 +25,13 @@ public class ContactField extends CustomField<Contact> implements HasClientValid
25
25
26
26
public static final String GAP_M_CSS = "gap-m" ;
27
27
private static final String FULL_WIDTH_CSS = "full-width" ;
28
+ private static final Logger log = logger (ContactField .class );
28
29
private final TextField fullName ;
29
30
private final TextField email ;
30
31
private final Checkbox setMyselfCheckBox ;
31
32
protected transient ComboBox <Contact > orcidSelection ;
32
33
private Contact myself ;
33
34
private boolean isOptional = true ;
34
- private static final Logger log = logger (ContactField .class );
35
35
36
36
private ContactField (String label , PersonLookupService personLookupService ) {
37
37
this .fullName = withErrorMessage (withPlaceHolder (new TextField (), "Please provide a name" ),
@@ -45,12 +45,27 @@ private ContactField(String label, PersonLookupService personLookupService) {
45
45
add (layoutFields (setMyselfCheckBox , layoutFields (fullName , email )), orcidSelection );
46
46
hideCheckbox (); // default is to hide the set myself checkbox
47
47
setMyselfCheckBox .addValueChangeListener (listener -> {
48
+ orcidSelection .setValue (null );
48
49
if (isChecked (listener .getSource ())) {
49
50
loadContact (this , myself );
50
51
}
51
52
});
52
- fullName .addValueChangeListener (listener -> updateValue ());
53
- email .addValueChangeListener (listener -> updateValue ());
53
+ fullName .addValueChangeListener (listener ->
54
+ {
55
+ //We need to make sure that the orcid information within the orcid selection is reset as soon as manual entry has begun
56
+ if (listener .isFromClient ()) {
57
+ orcidSelection .setValue (null );
58
+ }
59
+ updateValue ();
60
+ });
61
+ email .addValueChangeListener (listener ->
62
+ {
63
+ //We need to make sure that the orcid information within the orcid selection is reset as soon as manual entry has begun
64
+ if (listener .isFromClient ()) {
65
+ orcidSelection .setValue (null );
66
+ }
67
+ updateValue ();
68
+ });
54
69
}
55
70
56
71
private static void loadContact (ContactField field , Contact contact ) {
@@ -235,7 +250,7 @@ private void addOidcInfoItem(OidcType oidcType, String oidc) {
235
250
oidcLink .setTarget (AnchorTarget .BLANK );
236
251
OidcLogo oidcLogo = new OidcLogo (oidcType );
237
252
Span oidcSpan = new Span (oidcLogo , oidcLink );
238
- oidcSpan .addClassNames ("gap-02" , "icon-content- center" );
253
+ oidcSpan .addClassNames ("gap-02" , "flex-align-items- center" , "flex-horizontal " );
239
254
add (oidcSpan );
240
255
}
241
256
}
0 commit comments