Skip to content

Commit

Permalink
🚑 Fix long press for touch devices
Browse files Browse the repository at this point in the history
Fixes #538
  • Loading branch information
timmo001 committed Sep 29, 2019
1 parent f86c9a0 commit eedc9c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Components/Cards/Base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ function Base(props: BaseProps) {
userSelect: !toggleable ? 'text' : 'none'
}}
onClick={toggleable ? handleHassToggle : undefined}
onTouchStart={handleHold}
onMouseDown={handleHold}
onTouchCancel={handleHoldCancel}
onTouchEnd={handleHoldCancel}
onMouseUp={handleHoldCancel}
onMouseLeave={handleHoldCancel}>
<Card
Expand Down
3 changes: 3 additions & 0 deletions src/Components/Overview/Pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ function Pages(props: PagesProps) {
key={key}
value={page.key}
label={page.name}
onTouchStart={handleEditingPage(page)}
onMouseDown={handleEditingPage(page)}
onTouchCancel={handleCancelEdit}
onTouchEnd={handleCancelEdit}
onMouseUp={handleCancelEdit}
onMouseLeave={handleCancelEdit}
icon={
Expand Down

0 comments on commit eedc9c7

Please sign in to comment.