Skip to content

Commit

Permalink
fix select issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Dec 27, 2023
1 parent b0821b0 commit b88494d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions benchmark/benchmarks/krausest/lib/components/RowComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Application } from '@/components/Application';
import { TagComponent } from '@/components/TagComponent';
import { targetFor, type ComponentRenderTarget, type Destructors } from '@/utils/component';
import type { Item } from '@/utils/data';
import { Cell, cellFor, formula } from '@/utils/reactive';
import { cellFor, formula } from '@/utils/reactive';
// import { maybeUpdatingPropertyOpcode } from "@/utils/vm";

export function RowComponent(
Expand Down Expand Up @@ -38,7 +38,7 @@ export function RowComponent(
name: 'tr',
className: formula(() => {
return id === selectedCell.value ? 'danger' : '';
}),
}, 'className'),
// events: {
// mouseenter: onMouseEnter,
// mouseleave: onMouseLeave,
Expand Down
4 changes: 2 additions & 2 deletions benchmark/benchmarks/krausest/lib/components/TagComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ export function TagComponent(

const slotNode = slot || document.createTextNode('');

if (typeof className !== undefined) {
if (className !== undefined) {
maybeUpdatingPropertyOpcode(destructors, element, 'className', className);
}

if (typeof text !== undefined) {
if (text !== undefined) {
maybeUpdatingPropertyOpcode(destructors, slotNode, 'textContent', text);
}

Expand Down
6 changes: 3 additions & 3 deletions benchmark/benchmarks/krausest/lib/utils/reactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class MergedCell {
if (this.isConst) {
return this.fn();
}
if (null === currentTracker && !_isRendering) {
if (null === currentTracker && _isRendering) {
currentTracker = tracker();
try {
return this.fn();
Expand Down Expand Up @@ -139,6 +139,6 @@ export function cellFor<T extends object, K extends keyof T>(obj: T, key: K): Ce
return cellValue;
}

export function formula(fn: () => unknown) {
return new MergedCell(fn, 'formula');
export function formula(fn: () => unknown, debugName?: string) {
return new MergedCell(fn, `formula:${debugName ?? 'unknown'}`);
}

0 comments on commit b88494d

Please sign in to comment.