Skip to content

Commit

Permalink
set sidebar to 1 whenever block is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
MAX-786 committed Jul 5, 2024
1 parent bef1358 commit 6eaeb32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/volto-hydra/src/components/Iframe/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { BlockChooser } from '@plone/volto/components';
import { createPortal } from 'react-dom';
import { usePopper } from 'react-popper';
import UrlInput from '../UrlInput';
import { useDispatch } from 'react-redux';
import { setSidebarTab } from '@plone/volto/actions';

/**
* Format the URL for the Iframe with location, token and enabling edit mode
Expand Down Expand Up @@ -53,6 +55,7 @@ const Iframe = (props) => {
// useEffect(() => {
// setReady(true);
// }, []);
const dispatch = useDispatch();
const [addNewBlockOpened, setAddNewBlockOpened] = useState(false);
const [popperElement, setPopperElement] = useState(null);
const [referenceElement, setReferenceElement] = useState(null);
Expand Down Expand Up @@ -181,6 +184,7 @@ const Iframe = (props) => {
if (history.location.pathname.endsWith('/edit')) {
onSelectBlock(event.data.uid);
setAddNewBlockOpened(false);
dispatch(setSidebarTab(1));
}
break;

Expand Down

0 comments on commit 6eaeb32

Please sign in to comment.