Skip to content

Commit

Permalink
next map
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Jul 7, 2024
1 parent da2f00f commit 33e1a5d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/bits-ui/src/lib/bits/calendar/calendar.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ export class CalendarRootState {
}
if (!prev) return date;
const preventDeselect = this.preventDeselect.value;
console.log("preventDeselect", preventDeselect);
if (!preventDeselect && isSameDay(prev, date)) {
this.placeholder.value = date;
return undefined;
Expand Down
4 changes: 2 additions & 2 deletions packages/bits-ui/src/lib/bits/select/select.svelte.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ReadableBox, box } from "svelte-toolbelt";
import { Map } from "svelte/reactivity";
import { SvelteMap } from "svelte/reactivity";
import { untrack } from "svelte";
import type { ReadableBoxedValues, WritableBoxedValues } from "$lib/internal/box.svelte.js";
import { watch } from "$lib/internal/box.svelte.js";
Expand Down Expand Up @@ -94,7 +94,7 @@ export class SelectRootState {
contentFragment = $state<DocumentFragment | null>(null);

// A set of all the native options we'll use to render the native select element under the hood
#nativeOptionsSet = new Map<string, ReadableBox<SelectNativeOption>>();
#nativeOptionsSet = new SvelteMap<string, ReadableBox<SelectNativeOption>>();
// A key we'll use to rerender the native select when the options change to keep it in sync
nativeSelectKey = $derived.by(() => {
return Array.from(this.#nativeOptionsSet.values())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { untrack } from "svelte";
import { box, type ReadableBox, type WritableBox } from "svelte-toolbelt";
import type { TextSelectionLayerImplProps, TextSelectionLayerProps } from "./types.js";
import { box, type ReadableBox } from "svelte-toolbelt";
import type { TextSelectionLayerImplProps } from "./types.js";
import {
type EventCallback,
type ReadableBoxedValues,
Expand Down
4 changes: 2 additions & 2 deletions packages/bits-ui/src/lib/internal/useBodyScrollLock.svelte.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Map } from "svelte/reactivity";
import { SvelteMap } from "svelte/reactivity";
import { box } from "svelte-toolbelt";
import type { Fn } from "./types.js";
import { isBrowser, isIOS } from "./is.js";
Expand All @@ -14,7 +14,7 @@ export type ScrollBodyOption = {
};

const useBodyLockStackCount = createSharedHook(() => {
const map = new Map<string, boolean>();
const map = new SvelteMap<string, boolean>();

const locked = $derived.by(() => {
for (const value of map.values()) {
Expand Down

0 comments on commit 33e1a5d

Please sign in to comment.