MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / renderHiddenInput

Function renderHiddenInput

core/src/utils/helpers.ts:263–282  ·  view source on GitHub ↗
(
  always: boolean,
  container: HTMLElement,
  name: string,
  value: string | undefined | null,
  disabled: boolean
)

Source from the content-addressed store, hash-verified

261 * @param disabled If true, the input is disabled
262 */
263export const renderHiddenInput = (
264 always: boolean,
265 container: HTMLElement,
266 name: string,
267 value: string | undefined | null,
268 disabled: boolean
269) => {
270 if (always || hasShadowDom(container)) {
271 let input = container.querySelector('input.aux-input') as HTMLInputElement | null;
272 if (!input) {
273 input = container.ownerDocument!.createElement('input');
274 input.type = 'hidden';
275 input.classList.add('aux-input');
276 container.appendChild(input);
277 }
278 input.disabled = disabled;
279 input.name = name;
280 input.value = value || '';
281 }
282};
283
284export const clamp = (min: number, n: number, max: number) => {
285 return Math.max(min, Math.min(n, max));

Callers 6

renderMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90
renderMethod · 0.90

Calls 2

hasShadowDomFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected