@@ -217,8 +236,9 @@ const SearchResultsNew = ({
}, [shopperHouseInfo]);
useEffect(() => {
- const targetId =
- themeInfo?.length > 0
+ const targetId = panelInfo?.currentSpot
+ ? panelInfo?.currentSpot
+ : themeInfo?.length > 0
? "searchProduct-0"
: itemInfo?.length > 0
? "searchItemContents0"
@@ -230,7 +250,7 @@ const SearchResultsNew = ({
const spotTimeout = setTimeout(() => Spotlight.focus(targetId), 100);
return () => clearTimeout(spotTimeout);
- }, [themeInfo?.length, itemInfo?.length, showInfo?.length]);
+ }, [themeInfo?.length, itemInfo?.length, showInfo?.length, shopperHouseInfo]);
return (
@@ -300,10 +320,18 @@ const SearchResultsNew = ({
)}
{tab === 0 && (
-
+
)}
{tab === 1 && (
-
+
)}
diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ItemCard.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ItemCard.jsx
index e4b02768..925f3952 100644
--- a/com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ItemCard.jsx
+++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ItemCard.jsx
@@ -17,14 +17,25 @@ import { panel_names } from '../../../utils/Config';
import { SpotlightIds } from '../../../utils/SpotlightIds';
import css from './ItemCard.module.less';
-const ItemCard = ({ panelInfo, onClick, itemInfo }) => {
+const ItemCard = ({ panelInfo, onClick, itemInfo, searchQuery }) => {
const dispatch = useDispatch();
- const focusedContainerIdRef = useRef(panelInfo?.focusedContainerId);
const _handleItemClick = useCallback(
(patnrId, prdtId) => (ev) => {
+ const currentSpot =
+ Spotlight.getCurrent()?.getAttribute("data-spotlight-id") || null;
if (onClick) {
onClick(ev);
}
+ dispatch(
+ updatePanel({
+ name: panel_names.SEARCH_PANEL,
+ panelInfo: {
+ searchVal: searchQuery,
+ currentSpot,
+ tab: 0,
+ },
+ })
+ );
dispatch(
pushPanel({
name: panel_names.DETAIL_PANEL,
diff --git a/com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ShowCard.jsx b/com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ShowCard.jsx
index 0d701b5d..8c4c5e48 100644
--- a/com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ShowCard.jsx
+++ b/com.twin.app.shoptime/src/views/SearchPanel/SearchResultsNew/ShowCard.jsx
@@ -2,10 +2,14 @@ import React, { useCallback } from 'react';
import { useDispatch } from 'react-redux';
+import Spotlight from '@enact/spotlight';
import SpotlightContainerDecorator
from '@enact/spotlight/SpotlightContainerDecorator';
-import { pushPanel } from '../../../actions/panelActions';
+import {
+ pushPanel,
+ updatePanel,
+} from '../../../actions/panelActions';
import TItemCardNew, {
TYPES,
} from '../../../components/TItemCard/TItemCard.new';
@@ -14,7 +18,7 @@ import { SpotlightIds } from '../../../utils/SpotlightIds';
import css from './ShowCard.module.less';
const Container = SpotlightContainerDecorator({ enterTo: null }, "div");
-const ShowCard = ({ panelInfo, onClick, showInfo }) => {
+const ShowCard = ({ panelInfo, onClick, showInfo, searchQuery }) => {
const dispatch = useDispatch();
const handleClick = useCallback(
@@ -24,10 +28,22 @@ const ShowCard = ({ panelInfo, onClick, showInfo }) => {
const linkTpCd = tokens[1] || "";
const patnrId = tokens[4] || "";
const showId = tokens[5] || "";
+ const currentSpot =
+ Spotlight.getCurrent()?.getAttribute("data-spotlight-id") || null;
if (onClick) {
onClick();
}
+ dispatch(
+ updatePanel({
+ name: panel_names.SEARCH_PANEL,
+ panelInfo: {
+ searchVal: searchQuery,
+ currentSpot,
+ tab: 1,
+ },
+ })
+ );
dispatch(
pushPanel({