mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Do not rely on hover for upload form options if touch is used
This commit is contained in:
parent
0e8de56a22
commit
8f4fab65a1
@ -14,6 +14,7 @@ import IconButton from 'flavours/glitch/components/icon_button';
|
|||||||
// Utils.
|
// Utils.
|
||||||
import Motion from 'flavours/glitch/util/optional_motion';
|
import Motion from 'flavours/glitch/util/optional_motion';
|
||||||
import { assignHandlers } from 'flavours/glitch/util/react_helpers';
|
import { assignHandlers } from 'flavours/glitch/util/react_helpers';
|
||||||
|
import { isUserTouching } from 'flavours/glitch/util/is_mobile';
|
||||||
|
|
||||||
// Messages.
|
// Messages.
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
@ -130,7 +131,7 @@ export default class ComposerUploadFormItem extends React.PureComponent {
|
|||||||
hovered,
|
hovered,
|
||||||
dirtyDescription,
|
dirtyDescription,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
const active = hovered || focused;
|
const active = hovered || focused || isUserTouching();
|
||||||
const computedClass = classNames('composer--upload_form--item', { active });
|
const computedClass = classNames('composer--upload_form--item', { active });
|
||||||
const x = ((focusX / 2) + .5) * 100;
|
const x = ((focusX / 2) + .5) * 100;
|
||||||
const y = ((focusY / -2) + .5) * 100;
|
const y = ((focusY / -2) + .5) * 100;
|
||||||
|
Loading…
Reference in New Issue
Block a user