Browse Source

Do not rely on hover for upload form options if touch is used

closed-social-glitch-2
Thibaut Girka 6 years ago
committed by ThibG
parent
commit
8f4fab65a1
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      app/javascript/flavours/glitch/features/composer/upload_form/item/index.js

+ 2
- 1
app/javascript/flavours/glitch/features/composer/upload_form/item/index.js View File

@ -14,6 +14,7 @@ import IconButton from 'flavours/glitch/components/icon_button';
// Utils.
import Motion from 'flavours/glitch/util/optional_motion';
import { assignHandlers } from 'flavours/glitch/util/react_helpers';
import { isUserTouching } from 'flavours/glitch/util/is_mobile';
// Messages.
const messages = defineMessages({
@ -130,7 +131,7 @@ export default class ComposerUploadFormItem extends React.PureComponent {
hovered,
dirtyDescription,
} = this.state;
const active = hovered || focused;
const active = hovered || focused || isUserTouching();
const computedClass = classNames('composer--upload_form--item', { active });
const x = ((focusX / 2) + .5) * 100;
const y = ((focusY / -2) + .5) * 100;

Loading…
Cancel
Save