Skip to content

Commit

Permalink
Order tab to remain rendered after the initial load
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-17h committed Jan 19, 2025
1 parent 18400c6 commit f8272ca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/volto/src/components/manage/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const Sidebar = (props) => {
);
const [size] = useState(0);
const [showFull, setshowFull] = useState(true);
const [isOrderTabRendered, setIsOrderTabRendered] = useState(false);

const tab = useSelector((state) => state.sidebar.tab);
const toolbarExpanded = useSelector((state) => state.toolbar.expanded);
Expand Down Expand Up @@ -102,6 +103,10 @@ const Sidebar = (props) => {
const onTabChange = (event, data) => {
event.nativeEvent.stopImmediatePropagation();
dispatch(setSidebarTab(data.activeIndex));

if (data.activeIndex === 2) {
setIsOrderTabRendered(true);
}
};

return (
Expand Down Expand Up @@ -188,7 +193,7 @@ const Sidebar = (props) => {
!!orderTab && {
menuItem: intl.formatMessage(messages.order),
pane:
tab === 2 ? (
isOrderTabRendered || tab === 2 ? (
<Tab.Pane
key="order"
className="tab-wrapper"
Expand Down

0 comments on commit f8272ca

Please sign in to comment.