[fix] Hovered indicators shown when coarse pointer (#1985)

This PR hides hovered indicators when using a coarse pointer.

### Change Type

- [x] `patch` — Bug fix

### Test Plan

1. On an iPad or touch device, use the draw tool.
2. Select the select tool.
3. You should not see the hovered indicator on the drawn shape.


### Release Notes

- Hide hovered indicators on mobile / coarse pointer devices.
This commit is contained in:
Steve Ruiz 2023-10-02 16:21:28 +01:00 committed by GitHub
parent 8166766c19
commit 07fec633af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -346,11 +346,14 @@ function SelectedIdIndicators() {
const HoveredShapeIndicator = function HoveredShapeIndicator() {
const editor = useEditor()
const { HoveredShapeIndicator } = useEditorComponents()
const isCoarsePointer = useValue('coarse pointer', () => editor.instanceState.isCoarsePointer, [
editor,
])
const hoveredShapeId = useValue('hovered id', () => editor.currentPageState.hoveredShapeId, [
editor,
])
if (!hoveredShapeId || !HoveredShapeIndicator) return null
if (isCoarsePointer || !hoveredShapeId || !HoveredShapeIndicator) return null
return <HoveredShapeIndicator shapeId={hoveredShapeId} />
}