mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
fixed maps dialog mobile appearance
This commit is contained in:
parent
679c485b89
commit
df15cddb27
6 changed files with 26 additions and 9 deletions
|
@ -20,7 +20,13 @@ export class StickerDesc extends React.PureComponent<Props, State> {
|
|||
this.props.onChange(e.target.value);
|
||||
};
|
||||
|
||||
blockMouse = e => e.stopPropagation(); // todo: pass here locker for moving markers from Sticker.js
|
||||
blockMouse = e => {
|
||||
e.stopPropagation();
|
||||
this.input.focus();
|
||||
};
|
||||
|
||||
input: HTMLTextAreaElement;
|
||||
// todo: pass here locker for moving markers from Sticker.js
|
||||
|
||||
render() {
|
||||
const { text } = this.state;
|
||||
|
@ -30,6 +36,7 @@ export class StickerDesc extends React.PureComponent<Props, State> {
|
|||
className={classnames('sticker-desc', { is_empty: !text.trim() })}
|
||||
onMouseDown={this.blockMouse}
|
||||
onMouseUp={this.blockMouse}
|
||||
onDragStart={this.blockMouse}
|
||||
>
|
||||
<div className="sticker-desc-sizer">
|
||||
<span
|
||||
|
@ -42,6 +49,7 @@ export class StickerDesc extends React.PureComponent<Props, State> {
|
|||
value={text}
|
||||
onMouseDown={this.blockMouse}
|
||||
onDragStart={this.blockMouse}
|
||||
ref={el => { this.input = el; }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -9,6 +9,7 @@ import {
|
|||
searchSetTab,
|
||||
setDialogActive,
|
||||
} from '$redux/user/actions';
|
||||
import { isMobile } from '$utils/window';
|
||||
import classnames from 'classnames';
|
||||
|
||||
import { Range } from 'rc-slider';
|
||||
|
@ -44,6 +45,8 @@ class Component extends React.Component<Props, State> {
|
|||
};
|
||||
|
||||
openRoute = (_id: string): void => {
|
||||
if (isMobile) this.props.setDialogActive(false);
|
||||
|
||||
pushPath(`/${_id}/${this.props.editing ? 'edit' : ''}`);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue