Skip to content

Commit

Permalink
Сделал открытие на телефоне меню тэга при зажатии
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikMix committed May 31, 2024
1 parent 745e4aa commit e9c8dfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion public/src/components/NoteEditor/NoteEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class NoteEditor extends ScReact.Component<NoteEditorProps, NoteEditorTyp
dropdownOpen: true,
dropdownPos: {
left: elem.offsetLeft + 20,
top: elem.getBoundingClientRect().top + dropdownOffsetTop + window.screen.width < 1560 ? 20 : 0
top: elem.getBoundingClientRect().top + dropdownOffsetTop + (window.screen.width < 1560 ? -20 : 0)
}
}))
}
Expand Down
14 changes: 6 additions & 8 deletions public/src/components/TagsFilter/TagsFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ export class TagsFilter extends ScReact.Component<TagsFilterProps, TagsFilterSta
private presstimer = null;

click = (tag) => {
console.log('click')
console.log(this.state.menuOpen)
console.log("click")
console.log(this.longpress)

if (this.presstimer !== null) {
clearTimeout(this.presstimer);
Expand All @@ -177,8 +177,7 @@ export class TagsFilter extends ScReact.Component<TagsFilterProps, TagsFilterSta
}

start = (e, tag)=> {
console.log(e);

console.log("start")
if (e.type === "click" && e.button !== 0) {
return;
}
Expand All @@ -191,11 +190,10 @@ export class TagsFilter extends ScReact.Component<TagsFilterProps, TagsFilterSta
this.longpress = true;
}, 1000);

return false;
return true;
};

cancel = (e) => {
console.log("cancel")
cancel = () => {
if (this.presstimer !== null) {
clearTimeout(this.presstimer);
this.presstimer = null;
Expand Down Expand Up @@ -246,7 +244,7 @@ export class TagsFilter extends ScReact.Component<TagsFilterProps, TagsFilterSta
ontouchend={this.cancel}
ontouchleave={this.cancel}
ontouchcancel={this.cancel}
>
>
{tag}
</div>
))}
Expand Down

0 comments on commit e9c8dfa

Please sign in to comment.