bits-ui 1.3.1 → 1.3.2

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.
@@ -21,7 +21,6 @@ declare class PopoverTriggerState {
21
21
  readonly root: PopoverRootState;
22
22
  constructor(opts: PopoverTriggerStateProps, root: PopoverRootState);
23
23
  onclick(e: BitsMouseEvent): void;
24
- onpointerdown(e: BitsPointerEvent): void;
25
24
  onkeydown(e: BitsKeyboardEvent): void;
26
25
  props: {
27
26
  readonly id: string;
@@ -31,7 +30,6 @@ declare class PopoverTriggerState {
31
30
  readonly "aria-controls": string | undefined;
32
31
  readonly "data-popover-trigger": "";
33
32
  readonly disabled: boolean;
34
- readonly onpointerdown: (e: BitsPointerEvent) => void;
35
33
  readonly onkeydown: (e: BitsKeyboardEvent) => void;
36
34
  readonly onclick: (e: BitsMouseEvent) => void;
37
35
  };
@@ -32,7 +32,6 @@ class PopoverTriggerState {
32
32
  },
33
33
  });
34
34
  this.onclick = this.onclick.bind(this);
35
- this.onpointerdown = this.onpointerdown.bind(this);
36
35
  this.onkeydown = this.onkeydown.bind(this);
37
36
  }
38
37
  onclick(e) {
@@ -42,15 +41,6 @@ class PopoverTriggerState {
42
41
  return;
43
42
  this.root.toggleOpen();
44
43
  }
45
- onpointerdown(e) {
46
- if (this.opts.disabled.current)
47
- return;
48
- if (e.button !== 0)
49
- return;
50
- // We prevent default to prevent focus from moving to the trigger
51
- // since this action will open the popover and focus will move to the content
52
- e.preventDefault();
53
- }
54
44
  onkeydown(e) {
55
45
  if (this.opts.disabled.current)
56
46
  return;
@@ -74,7 +64,6 @@ class PopoverTriggerState {
74
64
  "data-popover-trigger": "",
75
65
  disabled: this.opts.disabled.current,
76
66
  //
77
- onpointerdown: this.onpointerdown,
78
67
  onkeydown: this.onkeydown,
79
68
  onclick: this.onclick,
80
69
  }));
@@ -577,7 +577,12 @@ class SelectTriggerState {
577
577
  onpointerup(e) {
578
578
  e.preventDefault();
579
579
  if (e.pointerType === "touch") {
580
- this.#handlePointerOpen(e);
580
+ if (this.root.opts.open.current === false) {
581
+ this.#handlePointerOpen(e);
582
+ }
583
+ else {
584
+ this.root.handleClose();
585
+ }
581
586
  }
582
587
  }
583
588
  props = $derived.by(() => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bits-ui",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "license": "MIT",
5
5
  "repository": "github:huntabyte/bits-ui",
6
6
  "funding": "https://github.com/sponsors/huntabyte",