This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
src/components/datepicker Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ md-datepicker.md-THEME_NAME-theme {
9
9
.md-datepicker-input-container {
10
10
border-bottom-color : ' {{background-300}}' ;
11
11
12
+ & .md-datepicker-focused {
13
+ border-bottom-color : ' {{primary-500}}'
14
+ }
15
+
12
16
& .md-datepicker-invalid {
13
17
border-bottom-color : ' {{warn-500}}' ;
14
18
}
Original file line number Diff line number Diff line change 48
48
'ng-click="ctrl.openCalendarPane($event)">' +
49
49
'<md-icon class="md-datepicker-calendar-icon" md-svg-icon="md-calendar"></md-icon>' +
50
50
'</md-button>' +
51
- '<div class="md-datepicker-input-container">' +
52
- '<input class="md-datepicker-input" aria-haspopup="true">' +
53
-
51
+ '<div class="md-datepicker-input-container" ' +
52
+ 'ng-class="{\'md-datepicker-focused\': ctrl.isFocused}">' +
53
+ '<input class="md-datepicker-input" aria-haspopup="true" ' +
54
+ 'ng-focus="ctrl.setFocused(true)" ng-blur="ctrl.setFocused(false)">' +
54
55
'<md-button md-no-ink class="md-datepicker-triangle-button md-icon-button" ' +
55
56
'ng-click="ctrl.openCalendarPane($event)" ' +
56
57
'aria-label="{{::ctrl.dateLocale.msgOpenCalendar}}">' +
143
144
/** @type {Date } */
144
145
this . date = null ;
145
146
147
+ /** @type {boolean } */
148
+ this . isFocused = false ;
149
+
146
150
/** @type {boolean } */
147
151
this . isDisabled ;
148
152
this . setDisabled ( $element [ 0 ] . disabled || angular . isString ( $attrs [ 'disabled' ] ) ) ;
371
375
} , false ) ;
372
376
} ;
373
377
378
+ /**
379
+ * Sets whether the input is currently focused.
380
+ * @param {boolean } isFocused
381
+ */
382
+ DatePickerCtrl . prototype . setFocused = function ( isFocused ) {
383
+ this . isFocused = isFocused ;
384
+ } ;
385
+
374
386
/**
375
387
* Handles a click on the document body when the floating calendar pane is open.
376
388
* Closes the floating calendar pane if the click is not inside of it.
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ $md-datepicker-open-animation-duration: 0.2s;
31
31
display : inline-block ;
32
32
width : auto ;
33
33
margin-left : $md-datepicker-button-gap ;
34
+
35
+ & .md-datepicker-focused {
36
+ border-bottom-width : 2px ;
37
+ }
34
38
}
35
39
36
40
You can’t perform that action at this time.
0 commit comments