@react-aria/combobox
Advanced tools
Comparing version
@@ -35,2 +35,3 @@ var { | ||
chain, | ||
isAppleDevice, | ||
mergeProps, | ||
@@ -64,6 +65,2 @@ useLabels | ||
function $fa71f27c5feed757eb58cfe0179b$var$isAppleDevice() { | ||
return typeof window !== 'undefined' && window.navigator != null ? /^(Mac|iPhone|iPad)/.test(window.navigator.platform) : false; | ||
} | ||
function useComboBox(props, state) { | ||
@@ -232,3 +229,3 @@ var _focusedItem$parentKe, _state$selectionManag; | ||
useEffect(() => { | ||
if ($fa71f27c5feed757eb58cfe0179b$var$isAppleDevice() && focusedItem != null && itemKey !== lastItem.current) { | ||
if (isAppleDevice() && focusedItem != null && itemKey !== lastItem.current) { | ||
let isSelected = state.selectionManager.isSelected(itemKey); | ||
@@ -258,3 +255,3 @@ let section = sectionKey != null ? state.collection.getItem(sectionKey) : null; | ||
// The exception is VoiceOver since this isn't included in the message above. | ||
let didOpenWithoutFocusedItem = state.isOpen !== lastOpen.current && (state.selectionManager.focusedKey == null || $fa71f27c5feed757eb58cfe0179b$var$isAppleDevice()); | ||
let didOpenWithoutFocusedItem = state.isOpen !== lastOpen.current && (state.selectionManager.focusedKey == null || isAppleDevice()); | ||
@@ -274,3 +271,3 @@ if (state.isOpen && (didOpenWithoutFocusedItem || optionCount !== lastSize.current)) { | ||
useEffect(() => { | ||
if ($fa71f27c5feed757eb58cfe0179b$var$isAppleDevice() && state.isFocused && state.selectedItem && state.selectedKey !== lastSelectedKey.current) { | ||
if (isAppleDevice() && state.isFocused && state.selectedItem && state.selectedKey !== lastSelectedKey.current) { | ||
let optionText = state.selectedItem['aria-label'] || state.selectedItem.textValue || ''; | ||
@@ -277,0 +274,0 @@ let announcement = formatMessage('selectedAnnouncement', { |
@@ -8,3 +8,3 @@ import { useTextField } from "@react-aria/textfield"; | ||
import { useEffect, useMemo, useRef } from "react"; | ||
import { chain, mergeProps, useLabels } from "@react-aria/utils"; | ||
import { chain, isAppleDevice, mergeProps, useLabels } from "@react-aria/utils"; | ||
import { ariaHideOutside } from "@react-aria/overlays"; | ||
@@ -21,7 +21,2 @@ import { announce } from "@react-aria/live-announcer"; | ||
}; | ||
function $be26f9e765ed670e72d5b46ae9eff69a$var$isAppleDevice() { | ||
return typeof window !== 'undefined' && window.navigator != null ? /^(Mac|iPhone|iPad)/.test(window.navigator.platform) : false; | ||
} | ||
export function useComboBox(props, state) { | ||
@@ -190,3 +185,3 @@ var _focusedItem$parentKe, _state$selectionManag; | ||
useEffect(() => { | ||
if ($be26f9e765ed670e72d5b46ae9eff69a$var$isAppleDevice() && focusedItem != null && itemKey !== lastItem.current) { | ||
if (isAppleDevice() && focusedItem != null && itemKey !== lastItem.current) { | ||
let isSelected = state.selectionManager.isSelected(itemKey); | ||
@@ -216,3 +211,3 @@ let section = sectionKey != null ? state.collection.getItem(sectionKey) : null; | ||
// The exception is VoiceOver since this isn't included in the message above. | ||
let didOpenWithoutFocusedItem = state.isOpen !== lastOpen.current && (state.selectionManager.focusedKey == null || $be26f9e765ed670e72d5b46ae9eff69a$var$isAppleDevice()); | ||
let didOpenWithoutFocusedItem = state.isOpen !== lastOpen.current && (state.selectionManager.focusedKey == null || isAppleDevice()); | ||
@@ -232,3 +227,3 @@ if (state.isOpen && (didOpenWithoutFocusedItem || optionCount !== lastSize.current)) { | ||
useEffect(() => { | ||
if ($be26f9e765ed670e72d5b46ae9eff69a$var$isAppleDevice() && state.isFocused && state.selectedItem && state.selectedKey !== lastSelectedKey.current) { | ||
if (isAppleDevice() && state.isFocused && state.selectedItem && state.selectedKey !== lastSelectedKey.current) { | ||
let optionText = state.selectedItem['aria-label'] || state.selectedItem.textValue || ''; | ||
@@ -235,0 +230,0 @@ let announcement = formatMessage('selectedAnnouncement', { |
{ | ||
"name": "@react-aria/combobox", | ||
"version": "3.0.0-nightly.2547+309a8a23", | ||
"version": "3.0.0-nightly.2555+cbaffb3e", | ||
"description": "Spectrum UI components in React", | ||
@@ -21,17 +21,17 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-aria/i18n": "3.0.0-nightly.869+309a8a23", | ||
"@react-aria/interactions": "3.0.0-nightly.869+309a8a23", | ||
"@react-aria/listbox": "3.2.4-nightly.2547+309a8a23", | ||
"@react-aria/live-announcer": "3.0.0-nightly.869+309a8a23", | ||
"@react-aria/menu": "3.1.4-nightly.2547+309a8a23", | ||
"@react-aria/overlays": "3.0.0-nightly.869+309a8a23", | ||
"@react-aria/selection": "3.0.0-nightly.869+309a8a23", | ||
"@react-aria/textfield": "3.0.0-nightly.869+309a8a23", | ||
"@react-aria/utils": "3.0.0-nightly.869+309a8a23", | ||
"@react-stately/collections": "3.0.0-nightly.869+309a8a23", | ||
"@react-stately/combobox": "3.0.0-nightly.2547+309a8a23", | ||
"@react-stately/layout": "3.2.1-nightly.2547+309a8a23", | ||
"@react-types/button": "3.3.1-nightly.2547+309a8a23", | ||
"@react-types/combobox": "3.0.0-nightly.2547+309a8a23", | ||
"@react-types/shared": "3.0.0-nightly.869+309a8a23" | ||
"@react-aria/i18n": "3.0.0-nightly.877+cbaffb3e", | ||
"@react-aria/interactions": "3.0.0-nightly.877+cbaffb3e", | ||
"@react-aria/listbox": "3.2.4-nightly.2555+cbaffb3e", | ||
"@react-aria/live-announcer": "3.0.0-nightly.877+cbaffb3e", | ||
"@react-aria/menu": "3.1.4-nightly.2555+cbaffb3e", | ||
"@react-aria/overlays": "3.0.0-nightly.877+cbaffb3e", | ||
"@react-aria/selection": "3.0.0-nightly.877+cbaffb3e", | ||
"@react-aria/textfield": "3.0.0-nightly.877+cbaffb3e", | ||
"@react-aria/utils": "3.0.0-nightly.877+cbaffb3e", | ||
"@react-stately/collections": "3.0.0-nightly.877+cbaffb3e", | ||
"@react-stately/combobox": "3.0.0-nightly.2555+cbaffb3e", | ||
"@react-stately/layout": "3.2.1-nightly.2555+cbaffb3e", | ||
"@react-types/button": "3.3.1-nightly.2555+cbaffb3e", | ||
"@react-types/combobox": "3.0.0-nightly.2555+cbaffb3e", | ||
"@react-types/shared": "3.0.0-nightly.877+cbaffb3e" | ||
}, | ||
@@ -44,3 +44,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "309a8a236d27c8766da70c1b416d63172c145c0f" | ||
"gitHead": "cbaffb3e7e94f5000c42d9153548021907250dee" | ||
} |
@@ -16,3 +16,3 @@ /* | ||
import {ariaHideOutside} from '@react-aria/overlays'; | ||
import {chain, mergeProps, useLabels} from '@react-aria/utils'; | ||
import {chain, isAppleDevice, mergeProps, useLabels} from '@react-aria/utils'; | ||
import {ComboBoxProps} from '@react-types/combobox'; | ||
@@ -46,8 +46,2 @@ import {ComboBoxState} from '@react-stately/combobox'; | ||
function isAppleDevice() { | ||
return typeof window !== 'undefined' && window.navigator != null | ||
? /^(Mac|iPhone|iPad)/.test(window.navigator.platform) | ||
: false; | ||
} | ||
export function useComboBox<T>(props: AriaComboBoxProps<T>, state: ComboBoxState<T>): ComboBoxAria { | ||
@@ -54,0 +48,0 @@ let { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
88193
-1.65%776
-1.27%