ion-picker-column.entry.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. /*!
  2. * (C) Ionic http://ionicframework.com - MIT License
  3. */
  4. import { r as registerInstance, c as createEvent, h, e as Host, f as getElement } from './index-527b9e34.js';
  5. import { d as doc } from './index-a5d50daf.js';
  6. import { r as raf, g as getElementRoot } from './helpers-d94bc8ad.js';
  7. import { a as hapticSelectionStart, b as hapticSelectionChanged, h as hapticSelectionEnd } from './haptic-ac164e4c.js';
  8. import { a as isPlatform, b as getIonMode } from './ionic-global-b26f573e.js';
  9. import { c as createColorClasses } from './theme-01f3f29c.js';
  10. import './index-cfd9c1f2.js';
  11. import './capacitor-59395cbd.js';
  12. const pickerColumnCss = ":host{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;max-width:100%;height:200px;font-size:22px;text-align:center}.assistive-focusable{left:0;right:0;top:0;bottom:0;position:absolute;z-index:1;pointer-events:none}.assistive-focusable:focus{outline:none}.picker-opts{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-width:26px;max-height:200px;outline:none;text-align:inherit;-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;overflow-x:hidden;overflow-y:scroll;scrollbar-width:none}.picker-item-empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.picker-opts::-webkit-scrollbar{display:none}::slotted(ion-picker-column-option){display:block;scroll-snap-align:center}.picker-item-empty,:host(:not([disabled])) ::slotted(ion-picker-column-option.option-disabled){scroll-snap-align:none}::slotted([slot=prefix]),::slotted([slot=suffix]){max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}::slotted([slot=prefix]){-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0;padding-bottom:0;-ms-flex-pack:end;justify-content:end}::slotted([slot=suffix]){-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0;padding-bottom:0;-ms-flex-pack:start;justify-content:start}:host(.picker-column-disabled) .picker-opts{overflow-y:hidden}:host(.picker-column-disabled) ::slotted(ion-picker-column-option){cursor:default;opacity:0.4;pointer-events:none}@media (any-hover: hover){:host(:focus) .picker-opts{outline:none;background:rgba(var(--ion-color-base-rgb), 0.2)}}";
  13. const IonPickerColumnStyle0 = pickerColumnCss;
  14. const PickerColumn = class {
  15. constructor(hostRef) {
  16. registerInstance(this, hostRef);
  17. this.ionChange = createEvent(this, "ionChange", 7);
  18. this.isScrolling = false;
  19. this.isColumnVisible = false;
  20. this.canExitInputMode = true;
  21. this.updateValueTextOnScroll = false;
  22. this.centerPickerItemInView = (target, smooth = true, canExitInputMode = true) => {
  23. const { isColumnVisible, scrollEl } = this;
  24. if (isColumnVisible && scrollEl) {
  25. // (Vertical offset from parent) - (three empty picker rows) + (half the height of the target to ensure the scroll triggers)
  26. const top = target.offsetTop - 3 * target.clientHeight + target.clientHeight / 2;
  27. if (scrollEl.scrollTop !== top) {
  28. /**
  29. * Setting this flag prevents input
  30. * mode from exiting in the picker column's
  31. * scroll callback. This is useful when the user manually
  32. * taps an item or types on the keyboard as both
  33. * of these can cause a scroll to occur.
  34. */
  35. this.canExitInputMode = canExitInputMode;
  36. this.updateValueTextOnScroll = false;
  37. scrollEl.scroll({
  38. top,
  39. left: 0,
  40. behavior: smooth ? 'smooth' : undefined,
  41. });
  42. }
  43. }
  44. };
  45. this.setPickerItemActiveState = (item, isActive) => {
  46. if (isActive) {
  47. item.classList.add(PICKER_ITEM_ACTIVE_CLASS);
  48. }
  49. else {
  50. item.classList.remove(PICKER_ITEM_ACTIVE_CLASS);
  51. }
  52. };
  53. /**
  54. * When ionInputModeChange is emitted, each column
  55. * needs to check if it is the one being made available
  56. * for text entry.
  57. */
  58. this.inputModeChange = (ev) => {
  59. if (!this.numericInput) {
  60. return;
  61. }
  62. const { useInputMode, inputModeColumn } = ev.detail;
  63. /**
  64. * If inputModeColumn is undefined then this means
  65. * all numericInput columns are being selected.
  66. */
  67. const isColumnActive = inputModeColumn === undefined || inputModeColumn === this.el;
  68. if (!useInputMode || !isColumnActive) {
  69. this.setInputModeActive(false);
  70. return;
  71. }
  72. this.setInputModeActive(true);
  73. };
  74. /**
  75. * Setting isActive will cause a re-render.
  76. * As a result, we do not want to cause the
  77. * re-render mid scroll as this will cause
  78. * the picker column to jump back to
  79. * whatever value was selected at the
  80. * start of the scroll interaction.
  81. */
  82. this.setInputModeActive = (state) => {
  83. if (this.isScrolling) {
  84. this.scrollEndCallback = () => {
  85. this.isActive = state;
  86. };
  87. return;
  88. }
  89. this.isActive = state;
  90. };
  91. /**
  92. * When the column scrolls, the component
  93. * needs to determine which item is centered
  94. * in the view and will emit an ionChange with
  95. * the item object.
  96. */
  97. this.initializeScrollListener = () => {
  98. /**
  99. * The haptics for the wheel picker are
  100. * an iOS-only feature. As a result, they should
  101. * be disabled on Android.
  102. */
  103. const enableHaptics = isPlatform('ios');
  104. const { el, scrollEl } = this;
  105. let timeout;
  106. let activeEl = this.activeItem;
  107. const scrollCallback = () => {
  108. raf(() => {
  109. var _a;
  110. if (!scrollEl)
  111. return;
  112. if (timeout) {
  113. clearTimeout(timeout);
  114. timeout = undefined;
  115. }
  116. if (!this.isScrolling) {
  117. enableHaptics && hapticSelectionStart();
  118. this.isScrolling = true;
  119. }
  120. /**
  121. * Select item in the center of the column
  122. * which is the month/year that we want to select
  123. */
  124. const bbox = scrollEl.getBoundingClientRect();
  125. const centerX = bbox.x + bbox.width / 2;
  126. const centerY = bbox.y + bbox.height / 2;
  127. /**
  128. * elementFromPoint returns the top-most element.
  129. * This means that if an ion-backdrop is overlaying the
  130. * picker then the appropriate picker column option will
  131. * not be selected. To account for this, we use elementsFromPoint
  132. * and use an Array.find to find the appropriate column option
  133. * at that point.
  134. *
  135. * Additionally, the picker column could be used in the
  136. * Shadow DOM (i.e. in ion-datetime) so we need to make
  137. * sure we are choosing the correct host otherwise
  138. * the elements returns by elementsFromPoint will be
  139. * retargeted. To account for this, we check to see
  140. * if the picker column has a parent shadow root. If
  141. * so, we use that shadow root when doing elementsFromPoint.
  142. * Otherwise, we just use the document.
  143. */
  144. const rootNode = el.getRootNode();
  145. const hasParentShadow = rootNode instanceof ShadowRoot;
  146. const referenceNode = hasParentShadow ? rootNode : doc;
  147. /**
  148. * If the reference node is undefined
  149. * then it's likely that doc is undefined
  150. * due to being in an SSR environment.
  151. */
  152. if (referenceNode === undefined) {
  153. return;
  154. }
  155. const elementsAtPoint = referenceNode.elementsFromPoint(centerX, centerY);
  156. /**
  157. * elementsFromPoint can returns multiple elements
  158. * so find the relevant picker column option if one exists.
  159. */
  160. const newActiveElement = elementsAtPoint.find((el) => el.tagName === 'ION-PICKER-COLUMN-OPTION');
  161. if (activeEl !== undefined) {
  162. this.setPickerItemActiveState(activeEl, false);
  163. }
  164. if (newActiveElement === undefined || newActiveElement.disabled) {
  165. return;
  166. }
  167. /**
  168. * If we are selecting a new value,
  169. * we need to run haptics again.
  170. */
  171. if (newActiveElement !== activeEl) {
  172. enableHaptics && hapticSelectionChanged();
  173. if (this.canExitInputMode) {
  174. /**
  175. * The native iOS wheel picker
  176. * only dismisses the keyboard
  177. * once the selected item has changed
  178. * as a result of a swipe
  179. * from the user. If `canExitInputMode` is
  180. * `false` then this means that the
  181. * scroll is happening as a result of
  182. * the `value` property programmatically changing
  183. * either by an application or by the user via the keyboard.
  184. */
  185. this.exitInputMode();
  186. }
  187. }
  188. activeEl = newActiveElement;
  189. this.setPickerItemActiveState(newActiveElement, true);
  190. /**
  191. * Set the aria-valuetext even though the value prop has not been updated yet.
  192. * This enables some screen readers to announce the value as the users drag
  193. * as opposed to when their release their pointer from the screen.
  194. *
  195. * When the value is programmatically updated, we will smoothly scroll
  196. * to the new option. However, we do not want to update aria-valuetext mid-scroll
  197. * as that can cause the old value to be briefly set before being set to the
  198. * correct option. This will cause some screen readers to announce the old value
  199. * again before announcing the new value. The correct valuetext will be set on render.
  200. */
  201. if (this.updateValueTextOnScroll) {
  202. (_a = this.assistiveFocusable) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-valuetext', this.getOptionValueText(newActiveElement));
  203. }
  204. timeout = setTimeout(() => {
  205. this.isScrolling = false;
  206. this.updateValueTextOnScroll = true;
  207. enableHaptics && hapticSelectionEnd();
  208. /**
  209. * Certain tasks (such as those that
  210. * cause re-renders) should only be done
  211. * once scrolling has finished, otherwise
  212. * flickering may occur.
  213. */
  214. const { scrollEndCallback } = this;
  215. if (scrollEndCallback) {
  216. scrollEndCallback();
  217. this.scrollEndCallback = undefined;
  218. }
  219. /**
  220. * Reset this flag as the
  221. * next scroll interaction could
  222. * be a scroll from the user. In this
  223. * case, we should exit input mode.
  224. */
  225. this.canExitInputMode = true;
  226. this.setValue(newActiveElement.value);
  227. }, 250);
  228. });
  229. };
  230. /**
  231. * Wrap this in an raf so that the scroll callback
  232. * does not fire when component is initially shown.
  233. */
  234. raf(() => {
  235. if (!scrollEl)
  236. return;
  237. scrollEl.addEventListener('scroll', scrollCallback);
  238. this.destroyScrollListener = () => {
  239. scrollEl.removeEventListener('scroll', scrollCallback);
  240. };
  241. });
  242. };
  243. /**
  244. * Tells the parent picker to
  245. * exit text entry mode. This is only called
  246. * when the selected item changes during scroll, so
  247. * we know that the user likely wants to scroll
  248. * instead of type.
  249. */
  250. this.exitInputMode = () => {
  251. const { parentEl } = this;
  252. if (parentEl == null)
  253. return;
  254. parentEl.exitInputMode();
  255. /**
  256. * setInputModeActive only takes
  257. * effect once scrolling stops to avoid
  258. * a component re-render while scrolling.
  259. * However, we want the visual active
  260. * indicator to go away immediately, so
  261. * we call classList.remove here.
  262. */
  263. this.el.classList.remove('picker-column-active');
  264. };
  265. /**
  266. * Find the next enabled option after the active option.
  267. * @param stride - How many options to "jump" over in order to select the next option.
  268. * This can be used to implement PageUp/PageDown behaviors where pressing these keys
  269. * scrolls the picker by more than 1 option. For example, a stride of 5 means select
  270. * the enabled option 5 options after the active one. Note that the actual option selected
  271. * may be past the stride if the option at the stride is disabled.
  272. */
  273. this.findNextOption = (stride = 1) => {
  274. const { activeItem } = this;
  275. if (!activeItem)
  276. return null;
  277. let prevNode = activeItem;
  278. let node = activeItem.nextElementSibling;
  279. while (node != null) {
  280. if (stride > 0) {
  281. stride--;
  282. }
  283. if (node.tagName === 'ION-PICKER-COLUMN-OPTION' && !node.disabled && stride === 0) {
  284. return node;
  285. }
  286. prevNode = node;
  287. // Use nextElementSibling instead of nextSibling to avoid text/comment nodes
  288. node = node.nextElementSibling;
  289. }
  290. return prevNode;
  291. };
  292. /**
  293. * Find the next enabled option after the active option.
  294. * @param stride - How many options to "jump" over in order to select the next option.
  295. * This can be used to implement PageUp/PageDown behaviors where pressing these keys
  296. * scrolls the picker by more than 1 option. For example, a stride of 5 means select
  297. * the enabled option 5 options before the active one. Note that the actual option selected
  298. * may be past the stride if the option at the stride is disabled.
  299. */
  300. this.findPreviousOption = (stride = 1) => {
  301. const { activeItem } = this;
  302. if (!activeItem)
  303. return null;
  304. let nextNode = activeItem;
  305. let node = activeItem.previousElementSibling;
  306. while (node != null) {
  307. if (stride > 0) {
  308. stride--;
  309. }
  310. if (node.tagName === 'ION-PICKER-COLUMN-OPTION' && !node.disabled && stride === 0) {
  311. return node;
  312. }
  313. nextNode = node;
  314. // Use previousElementSibling instead of previousSibling to avoid text/comment nodes
  315. node = node.previousElementSibling;
  316. }
  317. return nextNode;
  318. };
  319. this.onKeyDown = (ev) => {
  320. /**
  321. * The below operations should be inverted when running on a mobile device.
  322. * For example, swiping up will dispatch an "ArrowUp" event. On desktop,
  323. * this should cause the previous option to be selected. On mobile, swiping
  324. * up causes a view to scroll down. As a result, swiping up on mobile should
  325. * cause the next option to be selected. The Home/End operations remain
  326. * unchanged because those always represent the first/last options, respectively.
  327. */
  328. const mobile = isPlatform('mobile');
  329. let newOption = null;
  330. switch (ev.key) {
  331. case 'ArrowDown':
  332. newOption = mobile ? this.findPreviousOption() : this.findNextOption();
  333. break;
  334. case 'ArrowUp':
  335. newOption = mobile ? this.findNextOption() : this.findPreviousOption();
  336. break;
  337. case 'PageUp':
  338. newOption = mobile ? this.findNextOption(5) : this.findPreviousOption(5);
  339. break;
  340. case 'PageDown':
  341. newOption = mobile ? this.findPreviousOption(5) : this.findNextOption(5);
  342. break;
  343. case 'Home':
  344. /**
  345. * There is no guarantee that the first child will be an ion-picker-column-option,
  346. * so we do not use firstElementChild.
  347. */
  348. newOption = this.el.querySelector('ion-picker-column-option:first-of-type');
  349. break;
  350. case 'End':
  351. /**
  352. * There is no guarantee that the last child will be an ion-picker-column-option,
  353. * so we do not use lastElementChild.
  354. */
  355. newOption = this.el.querySelector('ion-picker-column-option:last-of-type');
  356. break;
  357. }
  358. if (newOption !== null) {
  359. this.setValue(newOption.value);
  360. // This stops any default browser behavior such as scrolling
  361. ev.preventDefault();
  362. }
  363. };
  364. /**
  365. * Utility to generate the correct text for aria-valuetext.
  366. */
  367. this.getOptionValueText = (el) => {
  368. var _a;
  369. return el ? (_a = el.getAttribute('aria-label')) !== null && _a !== void 0 ? _a : el.innerText : '';
  370. };
  371. /**
  372. * Render an element that overlays the column. This element is for assistive
  373. * tech to allow users to navigate the column up/down. This element should receive
  374. * focus as it listens for synthesized keyboard events as required by the
  375. * slider role: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/slider_role
  376. */
  377. this.renderAssistiveFocusable = () => {
  378. const { activeItem } = this;
  379. const valueText = this.getOptionValueText(activeItem);
  380. /**
  381. * When using the picker, the valuetext provides important context that valuenow
  382. * does not. Additionally, using non-zero valuemin/valuemax values can cause
  383. * WebKit to incorrectly announce numeric valuetext values (such as a year
  384. * like "2024") as percentages: https://bugs.webkit.org/show_bug.cgi?id=273126
  385. */
  386. return (h("div", { ref: (el) => (this.assistiveFocusable = el), class: "assistive-focusable", role: "slider", tabindex: this.disabled ? undefined : 0, "aria-label": this.ariaLabel, "aria-valuemin": 0, "aria-valuemax": 0, "aria-valuenow": 0, "aria-valuetext": valueText, "aria-orientation": "vertical", onKeyDown: (ev) => this.onKeyDown(ev) }));
  387. };
  388. this.ariaLabel = null;
  389. this.isActive = false;
  390. this.disabled = false;
  391. this.value = undefined;
  392. this.color = 'primary';
  393. this.numericInput = false;
  394. }
  395. ariaLabelChanged(newValue) {
  396. this.ariaLabel = newValue;
  397. }
  398. valueChange() {
  399. if (this.isColumnVisible) {
  400. /**
  401. * Only scroll the active item into view when the picker column
  402. * is actively visible to the user.
  403. */
  404. this.scrollActiveItemIntoView(true);
  405. }
  406. }
  407. /**
  408. * Only setup scroll listeners
  409. * when the picker is visible, otherwise
  410. * the container will have a scroll
  411. * height of 0px.
  412. */
  413. componentWillLoad() {
  414. /**
  415. * We cache parentEl in a local variable
  416. * so we don't need to keep accessing
  417. * the class variable (which comes with
  418. * a small performance hit)
  419. */
  420. const parentEl = (this.parentEl = this.el.closest('ion-picker'));
  421. const visibleCallback = (entries) => {
  422. /**
  423. * Browsers will sometimes group multiple IO events into a single callback.
  424. * As a result, we want to grab the last/most recent event in case there are multiple events.
  425. */
  426. const ev = entries[entries.length - 1];
  427. if (ev.isIntersecting) {
  428. const { activeItem, el } = this;
  429. this.isColumnVisible = true;
  430. /**
  431. * Because this initial call to scrollActiveItemIntoView has to fire before
  432. * the scroll listener is set up, we need to manage the active class manually.
  433. */
  434. const oldActive = getElementRoot(el).querySelector(`.${PICKER_ITEM_ACTIVE_CLASS}`);
  435. if (oldActive) {
  436. this.setPickerItemActiveState(oldActive, false);
  437. }
  438. this.scrollActiveItemIntoView();
  439. if (activeItem) {
  440. this.setPickerItemActiveState(activeItem, true);
  441. }
  442. this.initializeScrollListener();
  443. }
  444. else {
  445. this.isColumnVisible = false;
  446. if (this.destroyScrollListener) {
  447. this.destroyScrollListener();
  448. this.destroyScrollListener = undefined;
  449. }
  450. }
  451. };
  452. /**
  453. * Set the root to be the parent picker element
  454. * This causes the IO callback
  455. * to be fired in WebKit as soon as the element
  456. * is visible. If we used the default root value
  457. * then WebKit would only fire the IO callback
  458. * after any animations (such as a modal transition)
  459. * finished, and there would potentially be a flicker.
  460. */
  461. new IntersectionObserver(visibleCallback, { threshold: 0.001, root: this.parentEl }).observe(this.el);
  462. if (parentEl !== null) {
  463. // TODO(FW-2832): type
  464. parentEl.addEventListener('ionInputModeChange', (ev) => this.inputModeChange(ev));
  465. }
  466. }
  467. componentDidRender() {
  468. const { el, activeItem, isColumnVisible, value } = this;
  469. if (isColumnVisible && !activeItem) {
  470. const firstOption = el.querySelector('ion-picker-column-option');
  471. /**
  472. * If the picker column does not have an active item and the current value
  473. * does not match the first item in the picker column, that means
  474. * the value is out of bounds. In this case, we assign the value to the
  475. * first item to match the scroll position of the column.
  476. *
  477. */
  478. if (firstOption !== null && firstOption.value !== value) {
  479. this.setValue(firstOption.value);
  480. }
  481. }
  482. }
  483. /** @internal */
  484. async scrollActiveItemIntoView(smooth = false) {
  485. const activeEl = this.activeItem;
  486. if (activeEl) {
  487. this.centerPickerItemInView(activeEl, smooth, false);
  488. }
  489. }
  490. /**
  491. * Sets the value prop and fires the ionChange event.
  492. * This is used when we need to fire ionChange from
  493. * user-generated events that cannot be caught with normal
  494. * input/change event listeners.
  495. * @internal
  496. */
  497. async setValue(value) {
  498. if (this.disabled === true || this.value === value) {
  499. return;
  500. }
  501. this.value = value;
  502. this.ionChange.emit({ value });
  503. }
  504. /**
  505. * Sets focus on the scrollable container within the picker column.
  506. * Use this method instead of the global `pickerColumn.focus()`.
  507. */
  508. async setFocus() {
  509. if (this.assistiveFocusable) {
  510. this.assistiveFocusable.focus();
  511. }
  512. }
  513. connectedCallback() {
  514. var _a;
  515. this.ariaLabel = (_a = this.el.getAttribute('aria-label')) !== null && _a !== void 0 ? _a : 'Select a value';
  516. }
  517. get activeItem() {
  518. const { value } = this;
  519. const options = Array.from(this.el.querySelectorAll('ion-picker-column-option'));
  520. return options.find((option) => {
  521. /**
  522. * If the whole picker column is disabled, the current value should appear active
  523. * If the current value item is specifically disabled, it should not appear active
  524. */
  525. if (!this.disabled && option.disabled) {
  526. return false;
  527. }
  528. return option.value === value;
  529. });
  530. }
  531. render() {
  532. const { color, disabled, isActive, numericInput } = this;
  533. const mode = getIonMode(this);
  534. return (h(Host, { key: 'a221dc10f1eb7c41637a16d2c7167c16939822fd', class: createColorClasses(color, {
  535. [mode]: true,
  536. ['picker-column-active']: isActive,
  537. ['picker-column-numeric-input']: numericInput,
  538. ['picker-column-disabled']: disabled,
  539. }) }, this.renderAssistiveFocusable(), h("slot", { key: '81b0656f606856f3dc0a657bf167d81a5011405e', name: "prefix" }), h("div", { key: '71b9de67c04150255dd66592601c9d926db0c31c', "aria-hidden": "true", class: "picker-opts", ref: (el) => {
  540. this.scrollEl = el;
  541. },
  542. /**
  543. * When an element has an overlay scroll style and
  544. * a fixed height, Firefox will focus the scrollable
  545. * container if the content exceeds the container's
  546. * dimensions.
  547. *
  548. * This causes keyboard navigation to focus to this
  549. * element instead of going to the next element in
  550. * the tab order.
  551. *
  552. * The desired behavior is for the user to be able to
  553. * focus the assistive focusable element and tab to
  554. * the next element in the tab order. Instead of tabbing
  555. * to this element.
  556. *
  557. * To prevent this, we set the tabIndex to -1. This
  558. * will match the behavior of the other browsers.
  559. */
  560. tabIndex: -1 }, h("div", { key: 'ebdc2f08c83db0cf17b4be29f28fcb00f529601e', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '04ab56fcb8e6a7d6af00204c4560feb99ff34a56', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '6cf8f538903faf0fe1e4130f3eaf7b4e2e17cb52', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("slot", { key: '1cc392307b70c576be5b81b5226ceba735957f0f' }), h("div", { key: '23e3f28e2a99b9aa8b7c8f68ad9583e3ca63e9e2', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '8a0563f09780c3116af0caebe4f40587ec1f041f', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '13207e248fc0009f37e0c90a3ee2bac2f130b856', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0")), h("slot", { key: '55ecf2ab5f214f936c2468cbdb7952daf89416b8', name: "suffix" })));
  561. }
  562. get el() { return getElement(this); }
  563. static get watchers() { return {
  564. "aria-label": ["ariaLabelChanged"],
  565. "value": ["valueChange"]
  566. }; }
  567. };
  568. const PICKER_ITEM_ACTIVE_CLASS = 'option-active';
  569. PickerColumn.style = IonPickerColumnStyle0;
  570. export { PickerColumn as ion_picker_column };