Skip to content

Commit

Permalink
fix active tab in MenuSmile
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3orblade committed Apr 22, 2024
1 parent 52beaa4 commit 9f4c1b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ts/component/menu/smile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class MenuSmile extends React.Component<I.Menu, State> {
focusOnMount={true}
/>

<div className="items">
<div id="items" className="items">
<InfiniteLoader
rowCount={items.length}
loadMoreRows={() => {}}
Expand Down Expand Up @@ -303,6 +303,8 @@ class MenuSmile extends React.Component<I.Menu, State> {
};
};

console.log(tabs, tab);

return (
<div
ref={node => this.node = node}
Expand Down Expand Up @@ -683,13 +685,14 @@ class MenuSmile extends React.Component<I.Menu, State> {

setActive (item?: any, row?: number) {
const node = $(this.node);
const items = node.find('#items');

if (row && this.refList) {
this.refList.scrollToRow(Math.max(0, row));
};

Preview.tooltipHide(false);
node.find('.active').removeClass('active');
items.find('.active').removeClass('active');

this.active = item;

Expand Down

0 comments on commit 9f4c1b1

Please sign in to comment.