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

Commit 30de929

Browse files
TedSandernshahan
authored andcommitted
Make RootFocusable able to be instantiated on its own for cases where you want to wrap an element to make it Focusable.
PiperOrigin-RevId: 242929330
1 parent a040aa6 commit 30de929

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

angular_components/lib/focus/focus.dart

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import 'focus_interface.dart';
1616

1717
export 'focus_interface.dart';
1818

19-
/// An abstract class for components to extend if their programmatic focus
19+
/// A class for components to extend if their programmatic focus
2020
/// should simply put focus on root element.
21-
abstract class RootFocusable implements Focusable, Disposable {
21+
class RootFocusable implements Focusable, Disposable {
2222
Element _root;
2323
RootFocusable(this._root);
2424

@@ -57,17 +57,13 @@ abstract class ProjectedFocus implements Focusable {
5757
if (delegate is Focusable) {
5858
_resolvedFocusable = delegate;
5959
} else {
60-
_resolvedFocusable = _FocusableElement(delegate);
60+
_resolvedFocusable = RootFocusable(delegate);
6161
}
6262
_resolvedFocusable.focus();
6363
});
6464
}
6565
}
6666

67-
class _FocusableElement extends RootFocusable {
68-
_FocusableElement(HtmlElement element) : super(element);
69-
}
70-
7167
/// A focusable component that can publish to the
7268
/// `focusmove` stream in order to move focus to another element in the list.
7369
abstract class FocusableItem implements Focusable {

0 commit comments

Comments
 (0)