bits-ui 1.0.0-next.26 → 1.0.0-next.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -153,9 +153,8 @@ declare class CommandItemState {
153
153
  readonly "data-selected": "" | undefined;
154
154
  readonly "data-command-item": "";
155
155
  readonly role: "option";
156
- readonly onpointerdown: (e: PointerEvent) => void;
157
156
  readonly onpointermove: () => void;
158
- readonly onpointerup: (e: PointerEvent) => void;
157
+ readonly onclick: () => void;
159
158
  };
160
159
  }
161
160
  type CommandLoadingStateProps = WithRefProps<ReadableBoxedValues<{
@@ -236,7 +236,7 @@ class CommandRootState {
236
236
  if (!grandparent)
237
237
  return;
238
238
  const firstChildOfParent = getFirstNonCommentChild(grandparent);
239
- if (firstChildOfParent && firstChildOfParent.dataset.value === item.dataset.value) {
239
+ if (firstChildOfParent && firstChildOfParent.dataset?.value === item.dataset?.value) {
240
240
  item
241
241
  ?.closest(GROUP_SELECTOR)
242
242
  ?.querySelector(GROUP_HEADING_SELECTOR)
@@ -696,21 +696,11 @@ class CommandItemState {
696
696
  return;
697
697
  this.#select();
698
698
  };
699
- #onpointerdown = (e) => {
699
+ #onclick = () => {
700
700
  if (this.#disabled.current)
701
701
  return;
702
- if (e.pointerType === "touch" || e.button !== 0)
703
- return e.preventDefault();
704
702
  this.#onSelect();
705
703
  };
706
- #onpointerup = (e) => {
707
- if (this.#disabled.current)
708
- return;
709
- if (e.pointerType === "touch") {
710
- e.preventDefault();
711
- this.#onSelect();
712
- }
713
- };
714
704
  props = $derived.by(() => ({
715
705
  id: this.id.current,
716
706
  "aria-disabled": getAriaDisabled(this.#disabled.current),
@@ -719,9 +709,8 @@ class CommandItemState {
719
709
  "data-selected": getDataSelected(this.isSelected),
720
710
  [ITEM_ATTR]: "",
721
711
  role: "option",
722
- onpointerdown: this.#onpointerdown,
723
712
  onpointermove: this.#onpointermove,
724
- onpointerup: this.#onpointerup,
713
+ onclick: this.#onclick,
725
714
  }));
726
715
  }
727
716
  class CommandLoadingState {
@@ -82,8 +82,7 @@ declare class ToolbarGroupItemState {
82
82
  readonly "data-toolbar-item": "";
83
83
  readonly "data-toolbar-group-item": "";
84
84
  readonly disabled: true | undefined;
85
- readonly onpointerdown: (e: PointerEvent) => void;
86
- readonly onpointerup: (e: PointerEvent) => void;
85
+ readonly onclick: () => void;
87
86
  readonly onkeydown: (e: KeyboardEvent) => void;
88
87
  };
89
88
  }
@@ -133,21 +133,11 @@ class ToolbarGroupItemState {
133
133
  return;
134
134
  this.#group.toggleItem(this.#value.current);
135
135
  };
136
- #onpointerdown = (e) => {
136
+ #onclick = () => {
137
137
  if (this.#isDisabled)
138
138
  return;
139
- if (e.pointerType === "touch" || e.button !== 0)
140
- return e.preventDefault();
141
139
  this.toggleItem();
142
140
  };
143
- #onpointerup = (e) => {
144
- if (this.#isDisabled)
145
- return;
146
- if (e.pointerType === "touch") {
147
- e.preventDefault();
148
- this.toggleItem();
149
- }
150
- };
151
141
  #onkeydown = (e) => {
152
142
  if (this.#isDisabled)
153
143
  return;
@@ -180,8 +170,7 @@ class ToolbarGroupItemState {
180
170
  [GROUP_ITEM_ATTR]: "",
181
171
  disabled: getDisabled(this.#isDisabled),
182
172
  //
183
- onpointerdown: this.#onpointerdown,
184
- onpointerup: this.#onpointerup,
173
+ onclick: this.#onclick,
185
174
  onkeydown: this.#onkeydown,
186
175
  }));
187
176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bits-ui",
3
- "version": "1.0.0-next.26",
3
+ "version": "1.0.0-next.28",
4
4
  "license": "MIT",
5
5
  "repository": "github:huntabyte/bits-ui",
6
6
  "funding": "https://github.com/sponsors/huntabyte",