mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-11 18:20:27 +09:00
Merge pull request #434 from LavaCxx/improve-keyboard-control
Improve keyboard control on emoji picker
This commit is contained in:
commit
8730645746
1 changed files with 6 additions and 4 deletions
|
@ -534,11 +534,13 @@ class MenuSmile extends React.Component<I.Menu, State> {
|
|||
return;
|
||||
};
|
||||
|
||||
const child = current.children[this.coll];
|
||||
const firstBlankIndex = current.children.findIndex((item: any) => item.itemId == ID_BLANK);
|
||||
|
||||
if ((this.coll > current.children.length) || (child && (child.itemId == ID_BLANK))) {
|
||||
this.coll = 0;
|
||||
};
|
||||
if ((firstBlankIndex > -1) && (firstBlankIndex <= this.coll)) {
|
||||
this.coll = firstBlankIndex - 1;
|
||||
}
|
||||
|
||||
const child = current.children[this.coll];
|
||||
|
||||
this.setActive(child, this.row);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue