]> cat aescling's git repositories - mastodon.git/commitdiff
Do not rely on hover for upload form options if touch is used
authorThibaut Girka <thib@sitedethib.com>
Fri, 26 Oct 2018 14:46:53 +0000 (16:46 +0200)
committerThibG <thib@sitedethib.com>
Sat, 27 Oct 2018 17:06:49 +0000 (19:06 +0200)
app/javascript/flavours/glitch/features/composer/upload_form/item/index.js

index 5addccfb1181a44ad488473a3fdecaf6b850d27e..93fa4e39e1a90c0a568ca7fcaef81d36dc19637b 100644 (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;
This page took 0.024305 seconds and 3 git commands to generate.