Skip to content

Commit

Permalink
Revert back changes lost due to the rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
arminmeh committed Nov 20, 2024
1 parent d578c4f commit e5156af
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const useMultiInputFieldSlotProps = <
const previousRangePosition = React.useRef<RangePosition>(rangePosition);

React.useEffect(() => {
if (!open) {
if (!open || variant === 'mobile') {
return;
}

Expand All @@ -191,7 +191,7 @@ const useMultiInputFieldSlotProps = <
previousRangePosition.current === rangePosition ? currentView : 0,
);
previousRangePosition.current = rangePosition;
}, [rangePosition, open, currentView, startFieldRef, endFieldRef]);
}, [rangePosition, open, currentView, startFieldRef, endFieldRef, variant]);

const openRangeStartSelection: React.UIEventHandler = (event) => {
event.stopPropagation();
Expand Down Expand Up @@ -345,7 +345,7 @@ const useSingleInputFieldSlotProps = <
const handleFieldRef = useForkRef(fieldProps.unstableFieldRef, startFieldRef, endFieldRef);

React.useEffect(() => {
if (!open || !startFieldRef.current) {
if (!open || !startFieldRef.current || variant === 'mobile') {
return;
}

Expand All @@ -362,7 +362,7 @@ const useSingleInputFieldSlotProps = <
: sections.lastIndexOf(currentView);
startFieldRef.current?.focusField(newSelectedSection);
}
}, [rangePosition, open, currentView, startFieldRef]);
}, [rangePosition, open, currentView, startFieldRef, variant]);

const updateRangePosition = () => {
if (!startFieldRef.current?.isFieldFocused()) {
Expand Down

0 comments on commit e5156af

Please sign in to comment.