Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 3d2bbb7

Browse files
TedSandernshahan
authored andcommitted
Move ViewChild focusable to base class as the annotation can now be in the super class.
PiperOrigin-RevId: 250326498
1 parent fa21ccd commit 3d2bbb7

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

angular_components/lib/material_input/base_material_input.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,12 @@ class BaseMaterialInput extends FocusableMixin
489489
inputRef.nativeElement.select();
490490
}
491491

492+
@ViewChild(FocusableDirective)
493+
@override
494+
set focusable(Focusable value) {
495+
super.focusable = value;
496+
}
497+
492498
/// The message to display when character counter is shown.
493499
///
494500
/// The character count in the form "[currentCount] / [maxCount]", such as

angular_components/lib/material_input/material_input.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,6 @@ class MaterialInputComponent extends BaseMaterialInput
8686

8787
ChangeDetectorRef _changeDetector;
8888

89-
/// TODO(google): The following value could be set in the base class, but
90-
/// there is currently no working way to set ViewChild values on the base
91-
/// class.
92-
@ViewChild(FocusableDirective)
93-
@override
94-
set focusable(Focusable value) {
95-
super.focusable = value;
96-
}
97-
9889
@ViewChild('inputEl')
9990
ElementRef inputEl;
10091

angular_components/lib/material_input/material_input_multiline.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,6 @@ class MaterialMultilineInputComponent extends BaseMaterialInput
8989
: _changeDetector = changeDetector,
9090
super(cd, changeDetector, validator);
9191

92-
/// TODO(google): The following values could be set in the base class, but
93-
/// there is currently no working way to set ViewChild values on the base
94-
/// class.
95-
@ViewChild(FocusableDirective)
96-
@override
97-
set focusable(Focusable value) {
98-
super.focusable = value;
99-
}
100-
10192
// Overriden to add a HostListener event.
10293
@HostListener('focus')
10394
@override

0 commit comments

Comments
 (0)