(goto: number)
| 200 | } |
| 201 | |
| 202 | function focusElement(goto: number) { |
| 203 | if (goto > elements.length - 1) { |
| 204 | goto = elements.length - 1; |
| 205 | } else if (goto < 0) { |
| 206 | goto = 0; |
| 207 | } |
| 208 | setCurrent(goto); |
| 209 | let found = |
| 210 | ref?.current?.children[goto]?.getElementsByClassName('element')[0]; |
| 211 | if (!found) { |
| 212 | found = ref?.current?.children[goto]; |
| 213 | } |
| 214 | if (found) { |
| 215 | found.focus(); |
| 216 | } else { |
| 217 | ref.current.focus(); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | async function deleteElement(number: number) { |
| 222 | elements.splice(number, 1); |
no outgoing calls
no test coverage detected