1
0
Fork 0
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:
Razor 2023-12-30 10:31:43 +01:00 committed by GitHub
commit 8730645746
Signed by: github
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
};