( componentEl: HTMLElement, inputEl: HTMLInputElement | HTMLTextAreaElement, shouldRelocate: boolean, inputRelativeY = 0, disabledClonedInput = false )
| 1 | const cloneMap = new WeakMap<HTMLElement, HTMLElement>(); |
| 2 | |
| 3 | export const relocateInput = ( |
| 4 | componentEl: HTMLElement, |
| 5 | inputEl: HTMLInputElement | HTMLTextAreaElement, |
| 6 | shouldRelocate: boolean, |
| 7 | inputRelativeY = 0, |
| 8 | disabledClonedInput = false |
| 9 | ) => { |
| 10 | if (cloneMap.has(componentEl) === shouldRelocate) { |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | if (shouldRelocate) { |
| 15 | addClone(componentEl, inputEl, inputRelativeY, disabledClonedInput); |
| 16 | } else { |
| 17 | removeClone(componentEl, inputEl); |
| 18 | } |
| 19 | }; |
| 20 | |
| 21 | export const isFocused = (input: HTMLInputElement | HTMLTextAreaElement): boolean => { |
| 22 | /** |
no test coverage detected