MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / relocateInput

Function relocateInput

core/src/utils/input-shims/hacks/common.ts:3–19  ·  view source on GitHub ↗
(
  componentEl: HTMLElement,
  inputEl: HTMLInputElement | HTMLTextAreaElement,
  shouldRelocate: boolean,
  inputRelativeY = 0,
  disabledClonedInput = false
)

Source from the content-addressed store, hash-verified

1const cloneMap = new WeakMap<HTMLElement, HTMLElement>();
2
3export 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
21export const isFocused = (input: HTMLInputElement | HTMLTextAreaElement): boolean => {
22 /**

Callers 4

jsSetFocusFunction · 0.90
scrollContentFunction · 0.90
scrollHideCaretFunction · 0.90
onBlurFunction · 0.90

Calls 2

addCloneFunction · 0.85
removeCloneFunction · 0.85

Tested by

no test coverage detected