Skip to content

Commit

Permalink
Merge branch 'master' into windows-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Sep 6, 2023
2 parents 6ef6daa + 00b1f37 commit 486b45b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/data/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const pages: MuiPage[] = [
{ pathname: '/toolpad/getting-started/first-app', title: 'Build your first app' },
{
pathname: '/toolpad/examples-group',
title: 'Examples',
children: [
{ pathname: '/toolpad/examples', title: 'Overview' },
{ pathname: '/toolpad/examples/npm-stats', title: 'npm stats' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ import { useNodeNameValidation } from '../PagesExplorer/validation';
import { DomView } from '../../../utils/domView';
import { removePageLayoutNode } from '../pageLayout';

function CustomTreeItem(
props: TreeItemProps & {
node: appDom.ElementNode;
},
) {
export interface CustomTreeItemProps extends TreeItemProps {
ref?: React.RefObject<HTMLLIElement>;
node: appDom.ElementNode;
}

function CustomTreeItem(props: CustomTreeItemProps) {
const domApi = useDomApi();
const { dom } = useDom();
const appStateApi = useAppStateApi();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const StyledTreeItem = styled(TreeItem)({
},
});

type StyledTreeItemProps = TreeItemProps & {
interface StyledTreeItemProps extends TreeItemProps {
ref?: React.RefObject<HTMLLIElement>;
onDeleteNode?: (nodeId: NodeId) => void;
onDuplicateNode?: (nodeId: NodeId) => void;
onCreate?: React.MouseEventHandler;
Expand All @@ -49,7 +50,7 @@ type StyledTreeItemProps = TreeItemProps & {
deleteLabelText?: string;
duplicateLabelText?: string;
toolpadNodeId?: NodeId;
};
}

function PagesExplorerTreeItem(props: StyledTreeItemProps) {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function QueryEditor({
[setSelectedHandler],
);

const handlerTreeRef = React.useRef<HTMLDivElement>(null);
const handlerTreeRef = React.useRef<HTMLUListElement>(null);

React.useEffect(() => {
handlerTreeRef.current?.querySelector(`.${treeItemClasses.selected}`)?.scrollIntoView();
Expand Down

0 comments on commit 486b45b

Please sign in to comment.