Skip to content

Commit

Permalink
update focus onMouse
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreCrb committed Feb 13, 2020
1 parent 28d45b3 commit f71ee71
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/hooks/useInteractive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
getIsHovered,
} from '../core/selectors/components'
import { getShowLayout, getFocusedComponent } from '../core/selectors/app'
import { getInputTextFocused } from '../core/selectors/app'

export const useInteractive = (
component: IComponent,
Expand All @@ -17,8 +16,7 @@ export const useInteractive = (
const showLayout = useSelector(getShowLayout)
const isComponentSelected = useSelector(getIsSelectedComponent(component.id))
const isHovered = useSelector(getIsHovered(component.id))
const focusInput = useSelector(getInputTextFocused)
const useComponentFocused = useSelector(getFocusedComponent(component.id))
const focusInput = useSelector(getFocusedComponent(component.id))

const [, drag] = useDrag({
item: { id: component.id, type: component.type, isMoved: true },
Expand All @@ -33,9 +31,6 @@ export const useInteractive = (
},
onMouseOut: () => {
dispatch.components.unhover()
if (focusInput) {
dispatch.app.toggleInputText()
}
},
onClick: (event: MouseEvent) => {
event.preventDefault()
Expand Down

0 comments on commit f71ee71

Please sign in to comment.