Skip to content

Commit

Permalink
fix(devtools): Does not render correctly when title is an object (#3340)
Browse files Browse the repository at this point in the history
* fix(devtools): Does not render correctly when title is an object

* fix(devtools): does not render correctly when title is an object
  • Loading branch information
darkmice authored Aug 17, 2022
1 parent 1eca323 commit 4fb8305
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions devtools/chrome-extension/src/app/components/FieldTree.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState, useEffect, useRef } from 'react'
import styled from 'styled-components'
import { FormPath } from '@formily/shared'
import { FormPath, isObj } from '@formily/shared'
import { Treebeard, decorators } from 'react-treebeard'
import * as filters from './filter'
import SerachBox from './SearchBox'
import SearchBox from './SearchBox'

const createTree = (dataSource: any, cursor?: any) => {
const tree: any = {}
Expand Down Expand Up @@ -182,7 +182,7 @@ const Header = (props) => {
{node.name}
</span>
<span style={{ zIndex: 1, position: 'absolute', right: 12 }}>
{title}
{isObj(title) ? ((title as any).title ?? '') : title}
</span>
<div
className={`highlight ${node.active ? 'active' : ''}`}
Expand All @@ -196,7 +196,7 @@ const Header = (props) => {
const ToolBar = styled.div`
border-bottom: 1px solid #3d424a;
height: 20px;
padding: 10px 10;
padding: 10px 10px;
padding: 5px;
overflow: auto;
position: sticky;
Expand Down Expand Up @@ -246,7 +246,7 @@ export const FieldTree = styled(({ className, dataSource, onSelect }) => {
return (
<div className={className}>
<ToolBar>
<SerachBox onSearch={onSearch} />
<SearchBox onSearch={onSearch} />
</ToolBar>

<Treebeard
Expand Down

0 comments on commit 4fb8305

Please sign in to comment.