Commit 7355389
fix(button): focus method does not respect specified origin (#17183)
It looks like `MatButton` at some point has been refactored
to implement the `FocusableOption` interface so that it can
be used easily in the `FocusKeyManager`.
Currently since the `origin` parameter in the `focus` method
is not respected, the `FocusKeyManager#setFocusOrigin` method
is a noop for button elements. Additionally consumers of
`MatButton` who pass in a specific `FocusOrigin` when calling
the `focus` method will be surprised that the `origin` is simply
ignored (even though it's part of the public method signature; just
prefixed with an underscore).
We should just respect the focus origin to make the method
less confusing and to properly implement the `FocusableOption`.
Fixes #17174
(cherry picked from commit 1c307c8)1 parent cf244ff commit 7355389
File tree
3 files changed
+16
-5
lines changed- src/material/button
- tools/public_api_guard/material
3 files changed
+16
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
73 | 86 | | |
74 | 87 | | |
75 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 122 | + | |
| 123 | + | |
126 | 124 | | |
127 | 125 | | |
128 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
0 commit comments