Skip to content

Commit 986aeb3

Browse files
committed
on login username field also listens for enter key press
1 parent 8f4a8a9 commit 986aeb3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ui/UI.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ public void start(Stage primaryStage) throws Exception {
6767
_usernameField = new TextField();
6868
_passwordField = new PasswordField();
6969
// bind enter key to button press
70+
_usernameField.setOnKeyPressed((event) -> {
71+
if (event.getCode() == KeyCode.ENTER) {
72+
this.loginToGithub(null);
73+
}
74+
});
7075
_passwordField.setOnKeyPressed((event) -> {
7176
if (event.getCode() == KeyCode.ENTER) {
7277
this.loginToGithub(null);
@@ -121,7 +126,7 @@ public void displayAvailable(Employee employee) {
121126
if (_availabilityStage != null){
122127
_availabilityStage.close();
123128
}
124-
_availabilityStage = new AvailabilityStage("ShiftOverflow v" + VERSION, _controller, this);
129+
_availabilityStage = new AvailabilityStage("ShiftOverflow v" + UI.VERSION, _controller, this);
125130
_availabilityStage.show();
126131
}
127132

0 commit comments

Comments
 (0)