Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: components.js
});
[48500] Fix | Delete
}
[48501] Fix | Delete
});
[48502] Fix | Delete
};
[48503] Fix | Delete
[48504] Fix | Delete
this.menuRef = node => {
[48505] Fix | Delete
this._menuNode = node;
[48506] Fix | Delete
};
[48507] Fix | Delete
[48508] Fix | Delete
this.getMenuProps = function (_temp5, _temp6) {
[48509] Fix | Delete
let {
[48510] Fix | Delete
refKey = 'ref',
[48511] Fix | Delete
ref,
[48512] Fix | Delete
...props
[48513] Fix | Delete
} = _temp5 === void 0 ? {} : _temp5;
[48514] Fix | Delete
let {
[48515] Fix | Delete
suppressRefError = false
[48516] Fix | Delete
} = _temp6 === void 0 ? {} : _temp6;
[48517] Fix | Delete
_this.getMenuProps.called = true;
[48518] Fix | Delete
_this.getMenuProps.refKey = refKey;
[48519] Fix | Delete
_this.getMenuProps.suppressRefError = suppressRefError;
[48520] Fix | Delete
return {
[48521] Fix | Delete
[refKey]: handleRefs(ref, _this.menuRef),
[48522] Fix | Delete
role: 'listbox',
[48523] Fix | Delete
'aria-labelledby': props && props['aria-label'] ? null : _this.labelId,
[48524] Fix | Delete
id: _this.menuId,
[48525] Fix | Delete
...props
[48526] Fix | Delete
};
[48527] Fix | Delete
};
[48528] Fix | Delete
[48529] Fix | Delete
this.getItemProps = function (_temp7) {
[48530] Fix | Delete
let {
[48531] Fix | Delete
onMouseMove,
[48532] Fix | Delete
onMouseDown,
[48533] Fix | Delete
onClick,
[48534] Fix | Delete
onPress,
[48535] Fix | Delete
index,
[48536] Fix | Delete
item = true ?
[48537] Fix | Delete
/* istanbul ignore next */
[48538] Fix | Delete
undefined : 0,
[48539] Fix | Delete
...rest
[48540] Fix | Delete
} = _temp7 === void 0 ? {} : _temp7;
[48541] Fix | Delete
[48542] Fix | Delete
if (index === undefined) {
[48543] Fix | Delete
_this.items.push(item);
[48544] Fix | Delete
[48545] Fix | Delete
index = _this.items.indexOf(item);
[48546] Fix | Delete
} else {
[48547] Fix | Delete
_this.items[index] = item;
[48548] Fix | Delete
}
[48549] Fix | Delete
[48550] Fix | Delete
const onSelectKey = 'onClick';
[48551] Fix | Delete
const customClickHandler = onClick;
[48552] Fix | Delete
const enabledEventHandlers = {
[48553] Fix | Delete
// onMouseMove is used over onMouseEnter here. onMouseMove
[48554] Fix | Delete
// is only triggered on actual mouse movement while onMouseEnter
[48555] Fix | Delete
// can fire on DOM changes, interrupting keyboard navigation
[48556] Fix | Delete
onMouseMove: callAllEventHandlers(onMouseMove, () => {
[48557] Fix | Delete
if (index === _this.getState().highlightedIndex) {
[48558] Fix | Delete
return;
[48559] Fix | Delete
}
[48560] Fix | Delete
[48561] Fix | Delete
_this.setHighlightedIndex(index, {
[48562] Fix | Delete
type: itemMouseEnter
[48563] Fix | Delete
}); // We never want to manually scroll when changing state based
[48564] Fix | Delete
// on `onMouseMove` because we will be moving the element out
[48565] Fix | Delete
// from under the user which is currently scrolling/moving the
[48566] Fix | Delete
// cursor
[48567] Fix | Delete
[48568] Fix | Delete
[48569] Fix | Delete
_this.avoidScrolling = true;
[48570] Fix | Delete
[48571] Fix | Delete
_this.internalSetTimeout(() => _this.avoidScrolling = false, 250);
[48572] Fix | Delete
}),
[48573] Fix | Delete
onMouseDown: callAllEventHandlers(onMouseDown, event => {
[48574] Fix | Delete
// This prevents the activeElement from being changed
[48575] Fix | Delete
// to the item so it can remain with the current activeElement
[48576] Fix | Delete
// which is a more common use case.
[48577] Fix | Delete
event.preventDefault();
[48578] Fix | Delete
}),
[48579] Fix | Delete
[onSelectKey]: callAllEventHandlers(customClickHandler, () => {
[48580] Fix | Delete
_this.selectItemAtIndex(index, {
[48581] Fix | Delete
type: clickItem
[48582] Fix | Delete
});
[48583] Fix | Delete
})
[48584] Fix | Delete
}; // Passing down the onMouseDown handler to prevent redirect
[48585] Fix | Delete
// of the activeElement if clicking on disabled items
[48586] Fix | Delete
[48587] Fix | Delete
const eventHandlers = rest.disabled ? {
[48588] Fix | Delete
onMouseDown: enabledEventHandlers.onMouseDown
[48589] Fix | Delete
} : enabledEventHandlers;
[48590] Fix | Delete
return {
[48591] Fix | Delete
id: _this.getItemId(index),
[48592] Fix | Delete
role: 'option',
[48593] Fix | Delete
'aria-selected': _this.getState().highlightedIndex === index,
[48594] Fix | Delete
...eventHandlers,
[48595] Fix | Delete
...rest
[48596] Fix | Delete
};
[48597] Fix | Delete
};
[48598] Fix | Delete
[48599] Fix | Delete
this.clearItems = () => {
[48600] Fix | Delete
this.items = [];
[48601] Fix | Delete
};
[48602] Fix | Delete
[48603] Fix | Delete
this.reset = function (otherStateToSet, cb) {
[48604] Fix | Delete
if (otherStateToSet === void 0) {
[48605] Fix | Delete
otherStateToSet = {};
[48606] Fix | Delete
}
[48607] Fix | Delete
[48608] Fix | Delete
otherStateToSet = pickState(otherStateToSet);
[48609] Fix | Delete
[48610] Fix | Delete
_this.internalSetState(_ref => {
[48611] Fix | Delete
let {
[48612] Fix | Delete
selectedItem
[48613] Fix | Delete
} = _ref;
[48614] Fix | Delete
return {
[48615] Fix | Delete
isOpen: _this.props.defaultIsOpen,
[48616] Fix | Delete
highlightedIndex: _this.props.defaultHighlightedIndex,
[48617] Fix | Delete
inputValue: _this.props.itemToString(selectedItem),
[48618] Fix | Delete
...otherStateToSet
[48619] Fix | Delete
};
[48620] Fix | Delete
}, cb);
[48621] Fix | Delete
};
[48622] Fix | Delete
[48623] Fix | Delete
this.toggleMenu = function (otherStateToSet, cb) {
[48624] Fix | Delete
if (otherStateToSet === void 0) {
[48625] Fix | Delete
otherStateToSet = {};
[48626] Fix | Delete
}
[48627] Fix | Delete
[48628] Fix | Delete
otherStateToSet = pickState(otherStateToSet);
[48629] Fix | Delete
[48630] Fix | Delete
_this.internalSetState(_ref2 => {
[48631] Fix | Delete
let {
[48632] Fix | Delete
isOpen
[48633] Fix | Delete
} = _ref2;
[48634] Fix | Delete
return {
[48635] Fix | Delete
isOpen: !isOpen,
[48636] Fix | Delete
...(isOpen && {
[48637] Fix | Delete
highlightedIndex: _this.props.defaultHighlightedIndex
[48638] Fix | Delete
}),
[48639] Fix | Delete
...otherStateToSet
[48640] Fix | Delete
};
[48641] Fix | Delete
}, () => {
[48642] Fix | Delete
const {
[48643] Fix | Delete
isOpen,
[48644] Fix | Delete
highlightedIndex
[48645] Fix | Delete
} = _this.getState();
[48646] Fix | Delete
[48647] Fix | Delete
if (isOpen) {
[48648] Fix | Delete
if (_this.getItemCount() > 0 && typeof highlightedIndex === 'number') {
[48649] Fix | Delete
_this.setHighlightedIndex(highlightedIndex, otherStateToSet);
[48650] Fix | Delete
}
[48651] Fix | Delete
}
[48652] Fix | Delete
[48653] Fix | Delete
cbToCb(cb)();
[48654] Fix | Delete
});
[48655] Fix | Delete
};
[48656] Fix | Delete
[48657] Fix | Delete
this.openMenu = cb => {
[48658] Fix | Delete
this.internalSetState({
[48659] Fix | Delete
isOpen: true
[48660] Fix | Delete
}, cb);
[48661] Fix | Delete
};
[48662] Fix | Delete
[48663] Fix | Delete
this.closeMenu = cb => {
[48664] Fix | Delete
this.internalSetState({
[48665] Fix | Delete
isOpen: false
[48666] Fix | Delete
}, cb);
[48667] Fix | Delete
};
[48668] Fix | Delete
[48669] Fix | Delete
this.updateStatus = debounce(() => {
[48670] Fix | Delete
const state = this.getState();
[48671] Fix | Delete
const item = this.items[state.highlightedIndex];
[48672] Fix | Delete
const resultCount = this.getItemCount();
[48673] Fix | Delete
const status = this.props.getA11yStatusMessage({
[48674] Fix | Delete
itemToString: this.props.itemToString,
[48675] Fix | Delete
previousResultCount: this.previousResultCount,
[48676] Fix | Delete
resultCount,
[48677] Fix | Delete
highlightedItem: item,
[48678] Fix | Delete
...state
[48679] Fix | Delete
});
[48680] Fix | Delete
this.previousResultCount = resultCount;
[48681] Fix | Delete
setStatus(status, this.props.environment.document);
[48682] Fix | Delete
}, 200);
[48683] Fix | Delete
// fancy destructuring + defaults + aliases
[48684] Fix | Delete
// this basically says each value of state should either be set to
[48685] Fix | Delete
// the initial value or the default value if the initial value is not provided
[48686] Fix | Delete
const {
[48687] Fix | Delete
defaultHighlightedIndex,
[48688] Fix | Delete
initialHighlightedIndex: _highlightedIndex = defaultHighlightedIndex,
[48689] Fix | Delete
defaultIsOpen,
[48690] Fix | Delete
initialIsOpen: _isOpen = defaultIsOpen,
[48691] Fix | Delete
initialInputValue: _inputValue = '',
[48692] Fix | Delete
initialSelectedItem: _selectedItem = null
[48693] Fix | Delete
} = this.props;
[48694] Fix | Delete
[48695] Fix | Delete
const _state = this.getState({
[48696] Fix | Delete
highlightedIndex: _highlightedIndex,
[48697] Fix | Delete
isOpen: _isOpen,
[48698] Fix | Delete
inputValue: _inputValue,
[48699] Fix | Delete
selectedItem: _selectedItem
[48700] Fix | Delete
});
[48701] Fix | Delete
[48702] Fix | Delete
if (_state.selectedItem != null && this.props.initialInputValue === undefined) {
[48703] Fix | Delete
_state.inputValue = this.props.itemToString(_state.selectedItem);
[48704] Fix | Delete
}
[48705] Fix | Delete
[48706] Fix | Delete
this.state = _state;
[48707] Fix | Delete
}
[48708] Fix | Delete
[48709] Fix | Delete
/**
[48710] Fix | Delete
* Clear all running timeouts
[48711] Fix | Delete
*/
[48712] Fix | Delete
internalClearTimeouts() {
[48713] Fix | Delete
this.timeoutIds.forEach(id => {
[48714] Fix | Delete
clearTimeout(id);
[48715] Fix | Delete
});
[48716] Fix | Delete
this.timeoutIds = [];
[48717] Fix | Delete
}
[48718] Fix | Delete
/**
[48719] Fix | Delete
* Gets the state based on internal state or props
[48720] Fix | Delete
* If a state value is passed via props, then that
[48721] Fix | Delete
* is the value given, otherwise it's retrieved from
[48722] Fix | Delete
* stateToMerge
[48723] Fix | Delete
*
[48724] Fix | Delete
* @param {Object} stateToMerge defaults to this.state
[48725] Fix | Delete
* @return {Object} the state
[48726] Fix | Delete
*/
[48727] Fix | Delete
[48728] Fix | Delete
[48729] Fix | Delete
getState(stateToMerge) {
[48730] Fix | Delete
if (stateToMerge === void 0) {
[48731] Fix | Delete
stateToMerge = this.state;
[48732] Fix | Delete
}
[48733] Fix | Delete
[48734] Fix | Delete
return getState(stateToMerge, this.props);
[48735] Fix | Delete
}
[48736] Fix | Delete
[48737] Fix | Delete
getItemCount() {
[48738] Fix | Delete
// things read better this way. They're in priority order:
[48739] Fix | Delete
// 1. `this.itemCount`
[48740] Fix | Delete
// 2. `this.props.itemCount`
[48741] Fix | Delete
// 3. `this.items.length`
[48742] Fix | Delete
let itemCount = this.items.length;
[48743] Fix | Delete
[48744] Fix | Delete
if (this.itemCount != null) {
[48745] Fix | Delete
itemCount = this.itemCount;
[48746] Fix | Delete
} else if (this.props.itemCount !== undefined) {
[48747] Fix | Delete
itemCount = this.props.itemCount;
[48748] Fix | Delete
}
[48749] Fix | Delete
[48750] Fix | Delete
return itemCount;
[48751] Fix | Delete
}
[48752] Fix | Delete
[48753] Fix | Delete
getItemNodeFromIndex(index) {
[48754] Fix | Delete
return this.props.environment.document.getElementById(this.getItemId(index));
[48755] Fix | Delete
}
[48756] Fix | Delete
[48757] Fix | Delete
scrollHighlightedItemIntoView() {
[48758] Fix | Delete
/* istanbul ignore else (react-native) */
[48759] Fix | Delete
{
[48760] Fix | Delete
const node = this.getItemNodeFromIndex(this.getState().highlightedIndex);
[48761] Fix | Delete
this.props.scrollIntoView(node, this._menuNode);
[48762] Fix | Delete
}
[48763] Fix | Delete
}
[48764] Fix | Delete
[48765] Fix | Delete
moveHighlightedIndex(amount, otherStateToSet) {
[48766] Fix | Delete
const itemCount = this.getItemCount();
[48767] Fix | Delete
const {
[48768] Fix | Delete
highlightedIndex
[48769] Fix | Delete
} = this.getState();
[48770] Fix | Delete
[48771] Fix | Delete
if (itemCount > 0) {
[48772] Fix | Delete
const nextHighlightedIndex = getNextWrappingIndex(amount, highlightedIndex, itemCount, index => this.getItemNodeFromIndex(index));
[48773] Fix | Delete
this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet);
[48774] Fix | Delete
}
[48775] Fix | Delete
}
[48776] Fix | Delete
[48777] Fix | Delete
getStateAndHelpers() {
[48778] Fix | Delete
const {
[48779] Fix | Delete
highlightedIndex,
[48780] Fix | Delete
inputValue,
[48781] Fix | Delete
selectedItem,
[48782] Fix | Delete
isOpen
[48783] Fix | Delete
} = this.getState();
[48784] Fix | Delete
const {
[48785] Fix | Delete
itemToString
[48786] Fix | Delete
} = this.props;
[48787] Fix | Delete
const {
[48788] Fix | Delete
id
[48789] Fix | Delete
} = this;
[48790] Fix | Delete
const {
[48791] Fix | Delete
getRootProps,
[48792] Fix | Delete
getToggleButtonProps,
[48793] Fix | Delete
getLabelProps,
[48794] Fix | Delete
getMenuProps,
[48795] Fix | Delete
getInputProps,
[48796] Fix | Delete
getItemProps,
[48797] Fix | Delete
openMenu,
[48798] Fix | Delete
closeMenu,
[48799] Fix | Delete
toggleMenu,
[48800] Fix | Delete
selectItem,
[48801] Fix | Delete
selectItemAtIndex,
[48802] Fix | Delete
selectHighlightedItem,
[48803] Fix | Delete
setHighlightedIndex,
[48804] Fix | Delete
clearSelection,
[48805] Fix | Delete
clearItems,
[48806] Fix | Delete
reset,
[48807] Fix | Delete
setItemCount,
[48808] Fix | Delete
unsetItemCount,
[48809] Fix | Delete
internalSetState: setState
[48810] Fix | Delete
} = this;
[48811] Fix | Delete
return {
[48812] Fix | Delete
// prop getters
[48813] Fix | Delete
getRootProps,
[48814] Fix | Delete
getToggleButtonProps,
[48815] Fix | Delete
getLabelProps,
[48816] Fix | Delete
getMenuProps,
[48817] Fix | Delete
getInputProps,
[48818] Fix | Delete
getItemProps,
[48819] Fix | Delete
// actions
[48820] Fix | Delete
reset,
[48821] Fix | Delete
openMenu,
[48822] Fix | Delete
closeMenu,
[48823] Fix | Delete
toggleMenu,
[48824] Fix | Delete
selectItem,
[48825] Fix | Delete
selectItemAtIndex,
[48826] Fix | Delete
selectHighlightedItem,
[48827] Fix | Delete
setHighlightedIndex,
[48828] Fix | Delete
clearSelection,
[48829] Fix | Delete
clearItems,
[48830] Fix | Delete
setItemCount,
[48831] Fix | Delete
unsetItemCount,
[48832] Fix | Delete
setState,
[48833] Fix | Delete
// props
[48834] Fix | Delete
itemToString,
[48835] Fix | Delete
// derived
[48836] Fix | Delete
id,
[48837] Fix | Delete
// state
[48838] Fix | Delete
highlightedIndex,
[48839] Fix | Delete
inputValue,
[48840] Fix | Delete
isOpen,
[48841] Fix | Delete
selectedItem
[48842] Fix | Delete
};
[48843] Fix | Delete
} //////////////////////////// ROOT
[48844] Fix | Delete
[48845] Fix | Delete
[48846] Fix | Delete
componentDidMount() {
[48847] Fix | Delete
/* istanbul ignore if (react-native) */
[48848] Fix | Delete
if (false) {}
[48849] Fix | Delete
/* istanbul ignore if (react-native) */
[48850] Fix | Delete
[48851] Fix | Delete
[48852] Fix | Delete
{
[48853] Fix | Delete
// this.isMouseDown helps us track whether the mouse is currently held down.
[48854] Fix | Delete
// This is useful when the user clicks on an item in the list, but holds the mouse
[48855] Fix | Delete
// down long enough for the list to disappear (because the blur event fires on the input)
[48856] Fix | Delete
// this.isMouseDown is used in the blur handler on the input to determine whether the blur event should
[48857] Fix | Delete
// trigger hiding the menu.
[48858] Fix | Delete
const onMouseDown = () => {
[48859] Fix | Delete
this.isMouseDown = true;
[48860] Fix | Delete
};
[48861] Fix | Delete
[48862] Fix | Delete
const onMouseUp = event => {
[48863] Fix | Delete
this.isMouseDown = false; // if the target element or the activeElement is within a downshift node
[48864] Fix | Delete
// then we don't want to reset downshift
[48865] Fix | Delete
[48866] Fix | Delete
const contextWithinDownshift = targetWithinDownshift(event.target, [this._rootNode, this._menuNode], this.props.environment);
[48867] Fix | Delete
[48868] Fix | Delete
if (!contextWithinDownshift && this.getState().isOpen) {
[48869] Fix | Delete
this.reset({
[48870] Fix | Delete
type: mouseUp
[48871] Fix | Delete
}, () => this.props.onOuterClick(this.getStateAndHelpers()));
[48872] Fix | Delete
}
[48873] Fix | Delete
}; // Touching an element in iOS gives focus and hover states, but touching out of
[48874] Fix | Delete
// the element will remove hover, and persist the focus state, resulting in the
[48875] Fix | Delete
// blur event not being triggered.
[48876] Fix | Delete
// this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.
[48877] Fix | Delete
// If the user taps outside of Downshift, the component should be reset,
[48878] Fix | Delete
// but not if the user is swiping
[48879] Fix | Delete
[48880] Fix | Delete
[48881] Fix | Delete
const onTouchStart = () => {
[48882] Fix | Delete
this.isTouchMove = false;
[48883] Fix | Delete
};
[48884] Fix | Delete
[48885] Fix | Delete
const onTouchMove = () => {
[48886] Fix | Delete
this.isTouchMove = true;
[48887] Fix | Delete
};
[48888] Fix | Delete
[48889] Fix | Delete
const onTouchEnd = event => {
[48890] Fix | Delete
const contextWithinDownshift = targetWithinDownshift(event.target, [this._rootNode, this._menuNode], this.props.environment, false);
[48891] Fix | Delete
[48892] Fix | Delete
if (!this.isTouchMove && !contextWithinDownshift && this.getState().isOpen) {
[48893] Fix | Delete
this.reset({
[48894] Fix | Delete
type: touchEnd
[48895] Fix | Delete
}, () => this.props.onOuterClick(this.getStateAndHelpers()));
[48896] Fix | Delete
}
[48897] Fix | Delete
};
[48898] Fix | Delete
[48899] Fix | Delete
const {
[48900] Fix | Delete
environment
[48901] Fix | Delete
} = this.props;
[48902] Fix | Delete
environment.addEventListener('mousedown', onMouseDown);
[48903] Fix | Delete
environment.addEventListener('mouseup', onMouseUp);
[48904] Fix | Delete
environment.addEventListener('touchstart', onTouchStart);
[48905] Fix | Delete
environment.addEventListener('touchmove', onTouchMove);
[48906] Fix | Delete
environment.addEventListener('touchend', onTouchEnd);
[48907] Fix | Delete
[48908] Fix | Delete
this.cleanup = () => {
[48909] Fix | Delete
this.internalClearTimeouts();
[48910] Fix | Delete
this.updateStatus.cancel();
[48911] Fix | Delete
environment.removeEventListener('mousedown', onMouseDown);
[48912] Fix | Delete
environment.removeEventListener('mouseup', onMouseUp);
[48913] Fix | Delete
environment.removeEventListener('touchstart', onTouchStart);
[48914] Fix | Delete
environment.removeEventListener('touchmove', onTouchMove);
[48915] Fix | Delete
environment.removeEventListener('touchend', onTouchEnd);
[48916] Fix | Delete
};
[48917] Fix | Delete
}
[48918] Fix | Delete
}
[48919] Fix | Delete
[48920] Fix | Delete
shouldScroll(prevState, prevProps) {
[48921] Fix | Delete
const {
[48922] Fix | Delete
highlightedIndex: currentHighlightedIndex
[48923] Fix | Delete
} = this.props.highlightedIndex === undefined ? this.getState() : this.props;
[48924] Fix | Delete
const {
[48925] Fix | Delete
highlightedIndex: prevHighlightedIndex
[48926] Fix | Delete
} = prevProps.highlightedIndex === undefined ? prevState : prevProps;
[48927] Fix | Delete
const scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;
[48928] Fix | Delete
const scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;
[48929] Fix | Delete
return scrollWhenOpen || scrollWhenNavigating;
[48930] Fix | Delete
}
[48931] Fix | Delete
[48932] Fix | Delete
componentDidUpdate(prevProps, prevState) {
[48933] Fix | Delete
if (false) {}
[48934] Fix | Delete
[48935] Fix | Delete
if (isControlledProp(this.props, 'selectedItem') && this.props.selectedItemChanged(prevProps.selectedItem, this.props.selectedItem)) {
[48936] Fix | Delete
this.internalSetState({
[48937] Fix | Delete
type: controlledPropUpdatedSelectedItem,
[48938] Fix | Delete
inputValue: this.props.itemToString(this.props.selectedItem)
[48939] Fix | Delete
});
[48940] Fix | Delete
}
[48941] Fix | Delete
[48942] Fix | Delete
if (!this.avoidScrolling && this.shouldScroll(prevState, prevProps)) {
[48943] Fix | Delete
this.scrollHighlightedItemIntoView();
[48944] Fix | Delete
}
[48945] Fix | Delete
/* istanbul ignore else (react-native) */
[48946] Fix | Delete
[48947] Fix | Delete
[48948] Fix | Delete
{
[48949] Fix | Delete
this.updateStatus();
[48950] Fix | Delete
}
[48951] Fix | Delete
}
[48952] Fix | Delete
[48953] Fix | Delete
componentWillUnmount() {
[48954] Fix | Delete
this.cleanup(); // avoids memory leak
[48955] Fix | Delete
}
[48956] Fix | Delete
[48957] Fix | Delete
render() {
[48958] Fix | Delete
const children = unwrapArray(this.props.children, downshift_esm_noop); // because the items are rerendered every time we call the children
[48959] Fix | Delete
// we clear this out each render and it will be populated again as
[48960] Fix | Delete
// getItemProps is called.
[48961] Fix | Delete
[48962] Fix | Delete
this.clearItems(); // we reset this so we know whether the user calls getRootProps during
[48963] Fix | Delete
// this render. If they do then we don't need to do anything,
[48964] Fix | Delete
// if they don't then we need to clone the element they return and
[48965] Fix | Delete
// apply the props for them.
[48966] Fix | Delete
[48967] Fix | Delete
this.getRootProps.called = false;
[48968] Fix | Delete
this.getRootProps.refKey = undefined;
[48969] Fix | Delete
this.getRootProps.suppressRefError = undefined; // we do something similar for getMenuProps
[48970] Fix | Delete
[48971] Fix | Delete
this.getMenuProps.called = false;
[48972] Fix | Delete
this.getMenuProps.refKey = undefined;
[48973] Fix | Delete
this.getMenuProps.suppressRefError = undefined; // we do something similar for getLabelProps
[48974] Fix | Delete
[48975] Fix | Delete
this.getLabelProps.called = false; // and something similar for getInputProps
[48976] Fix | Delete
[48977] Fix | Delete
this.getInputProps.called = false;
[48978] Fix | Delete
const element = unwrapArray(children(this.getStateAndHelpers()));
[48979] Fix | Delete
[48980] Fix | Delete
if (!element) {
[48981] Fix | Delete
return null;
[48982] Fix | Delete
}
[48983] Fix | Delete
[48984] Fix | Delete
if (this.getRootProps.called || this.props.suppressRefError) {
[48985] Fix | Delete
if (false) {}
[48986] Fix | Delete
[48987] Fix | Delete
return element;
[48988] Fix | Delete
} else if (isDOMElement(element)) {
[48989] Fix | Delete
// they didn't apply the root props, but we can clone
[48990] Fix | Delete
// this and apply the props ourselves
[48991] Fix | Delete
return /*#__PURE__*/cloneElement(element, this.getRootProps(getElementProps(element)));
[48992] Fix | Delete
}
[48993] Fix | Delete
/* istanbul ignore else */
[48994] Fix | Delete
[48995] Fix | Delete
[48996] Fix | Delete
if (false) {}
[48997] Fix | Delete
/* istanbul ignore next */
[48998] Fix | Delete
[48999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function