Commit 5598169
Elliot
TreeItem: Support Cmd + Enter callback prop (#1556)
* Added onMetaEnter prop to TreeItem to catch CMD + Enter key
* Added docs for onMetaEnterKeyDown
* Added proper prop name
* Change prop name from onMetaEnterKeyDown to onMetaEnter
* Modified handleKeyDown to trigger onClick on Cmd + Enter when onMetaEnter is NOT provided
* Removed fallback behavior of cmd+enter to onClick and updated event.keyCode usages to event.key
* Combined enter and cmd+enter checks in handleKeyDown
* Replaced passed-in handler undefined checks with noop default value assign
* Added better explanation of onMetaEnter on tree docs1 parent 42353ee commit 5598169
File tree
3 files changed
+29
-9
lines changed- packages/components/src/Tree
- stories
- www/src/documentation/components/content
3 files changed
+29
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| 112 | + | |
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
| |||
113 | 120 | | |
114 | 121 | | |
115 | 122 | | |
116 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
117 | 130 | | |
118 | 131 | | |
119 | 132 | | |
| |||
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
145 | | - | |
| 158 | + | |
146 | 159 | | |
147 | 160 | | |
148 | 161 | | |
149 | | - | |
| 162 | + | |
150 | 163 | | |
151 | 164 | | |
152 | | - | |
| 165 | + | |
153 | 166 | | |
154 | 167 | | |
155 | 168 | | |
| |||
162 | 175 | | |
163 | 176 | | |
164 | 177 | | |
165 | | - | |
166 | | - | |
| 178 | + | |
| 179 | + | |
167 | 180 | | |
168 | 181 | | |
169 | | - | |
| 182 | + | |
170 | 183 | | |
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
174 | | - | |
| 187 | + | |
175 | 188 | | |
176 | 189 | | |
177 | 190 | | |
| |||
185 | 198 | | |
186 | 199 | | |
187 | 200 | | |
| 201 | + | |
188 | 202 | | |
189 | 203 | | |
190 | 204 | | |
| |||
197 | 211 | | |
198 | 212 | | |
199 | 213 | | |
200 | | - | |
| 214 | + | |
201 | 215 | | |
202 | 216 | | |
203 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
189 | 193 | | |
| 194 | + | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| |||
0 commit comments