Skip to content

Commit

Permalink
[form-builder] PTE: fix casing issue, and remove unnecessary typecast
Browse files Browse the repository at this point in the history
  • Loading branch information
skogsmaskin authored and bjoerge committed Aug 21, 2020
1 parent a82cb20 commit bfea39e
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -80,7 +80,7 @@ export default function PortableTextInput(props: Props) {

// States
const [isActive, setIsActive] = useState(false)
const [objectEditData, setobjectEditData] = useState(null) as [ObjectEditData, any]
const [objectEditData, setObjectEditData]: [ObjectEditData, any] = useState(null)
const [showValidationTooltip, setShowValidationTooltip] = useState(false)
const [initialSelection, setInitialSelection] = useState(undefined)

Expand Down Expand Up @@ -109,7 +109,7 @@ export default function PortableTextInput(props: Props) {
focus: {path: spanPath, offset: 0},
anchor: {path: spanPath, offset: 0}
})
setobjectEditData({
setObjectEditData({
editorPath: spanPath,
formBuilderPath: focusPath.slice(0, 3),
kind: 'annotation'
Expand All @@ -133,7 +133,7 @@ export default function PortableTextInput(props: Props) {
focus: {path, offset: 0},
anchor: {path, offset: 0}
})
setobjectEditData({editorPath: path, formBuilderPath: path, kind})
setObjectEditData({editorPath: path, formBuilderPath: path, kind})
}
}
}, [focusPath])
Expand Down Expand Up @@ -296,7 +296,7 @@ export default function PortableTextInput(props: Props) {
}
const handleClose = () => {
const {editorPath} = objectEditData
setobjectEditData(null)
setObjectEditData(null)
const sel = {
focus: {path: editorPath, offset: 0},
anchor: {path: editorPath, offset: 0}
Expand Down

0 comments on commit bfea39e

Please sign in to comment.