@surdeddd/bottom-sheet 0.20.0 → 0.20.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.
package/dist/core.cjs CHANGED
@@ -838,23 +838,25 @@ var ScrimController = class {
838
838
  if (!progressChanged && this.backdropOpacitySentinel.value !== -1 && this.screenOpacitySentinel.value !== -1) {
839
839
  return;
840
840
  }
841
- if (this.backdrop && this.isTopSheet()) {
841
+ if (this.backdrop) {
842
842
  const [s, e] = this.backdropRange;
843
843
  const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
844
844
  const backdropOpacity = Math.min(
845
845
  Math.max((progress - s) / range, 0),
846
846
  1
847
847
  );
848
- if (this.backdropOpacitySentinel.shouldWrite(
849
- backdropOpacity,
850
- OPACITY_WRITE_EPSILON
851
- )) {
852
- this.backdrop.style.opacity = String(backdropOpacity);
853
- }
854
- const nextPointer = backdropOpacity > POINTER_EVENTS_OPACITY_THRESHOLD ? "auto" : "none";
855
- if (nextPointer !== this.lastBackdropPointer) {
856
- this.backdrop.style.pointerEvents = nextPointer;
857
- this.lastBackdropPointer = nextPointer;
848
+ if (this.isTopSheet() || backdropOpacity === 0) {
849
+ if (this.backdropOpacitySentinel.shouldWrite(
850
+ backdropOpacity,
851
+ OPACITY_WRITE_EPSILON
852
+ )) {
853
+ this.backdrop.style.opacity = String(backdropOpacity);
854
+ }
855
+ const nextPointer = backdropOpacity > POINTER_EVENTS_OPACITY_THRESHOLD ? "auto" : "none";
856
+ if (nextPointer !== this.lastBackdropPointer) {
857
+ this.backdrop.style.pointerEvents = nextPointer;
858
+ this.lastBackdropPointer = nextPointer;
859
+ }
858
860
  }
859
861
  }
860
862
  if (this.screenComponent && this.scrimMode !== "off") {
package/dist/core.js CHANGED
@@ -836,23 +836,25 @@ var ScrimController = class {
836
836
  if (!progressChanged && this.backdropOpacitySentinel.value !== -1 && this.screenOpacitySentinel.value !== -1) {
837
837
  return;
838
838
  }
839
- if (this.backdrop && this.isTopSheet()) {
839
+ if (this.backdrop) {
840
840
  const [s, e] = this.backdropRange;
841
841
  const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
842
842
  const backdropOpacity = Math.min(
843
843
  Math.max((progress - s) / range, 0),
844
844
  1
845
845
  );
846
- if (this.backdropOpacitySentinel.shouldWrite(
847
- backdropOpacity,
848
- OPACITY_WRITE_EPSILON
849
- )) {
850
- this.backdrop.style.opacity = String(backdropOpacity);
851
- }
852
- const nextPointer = backdropOpacity > POINTER_EVENTS_OPACITY_THRESHOLD ? "auto" : "none";
853
- if (nextPointer !== this.lastBackdropPointer) {
854
- this.backdrop.style.pointerEvents = nextPointer;
855
- this.lastBackdropPointer = nextPointer;
846
+ if (this.isTopSheet() || backdropOpacity === 0) {
847
+ if (this.backdropOpacitySentinel.shouldWrite(
848
+ backdropOpacity,
849
+ OPACITY_WRITE_EPSILON
850
+ )) {
851
+ this.backdrop.style.opacity = String(backdropOpacity);
852
+ }
853
+ const nextPointer = backdropOpacity > POINTER_EVENTS_OPACITY_THRESHOLD ? "auto" : "none";
854
+ if (nextPointer !== this.lastBackdropPointer) {
855
+ this.backdrop.style.pointerEvents = nextPointer;
856
+ this.lastBackdropPointer = nextPointer;
857
+ }
856
858
  }
857
859
  }
858
860
  if (this.screenComponent && this.scrimMode !== "off") {
package/dist/element.cjs CHANGED
@@ -949,23 +949,25 @@ var init_scrim_controller = __esm({
949
949
  if (!progressChanged && this.backdropOpacitySentinel.value !== -1 && this.screenOpacitySentinel.value !== -1) {
950
950
  return;
951
951
  }
952
- if (this.backdrop && this.isTopSheet()) {
952
+ if (this.backdrop) {
953
953
  const [s, e] = this.backdropRange;
954
954
  const range = Math.max(e - s, RANGE_DIVISION_EPSILON);
955
955
  const backdropOpacity = Math.min(
956
956
  Math.max((progress - s) / range, 0),
957
957
  1
958
958
  );
959
- if (this.backdropOpacitySentinel.shouldWrite(
960
- backdropOpacity,
961
- OPACITY_WRITE_EPSILON
962
- )) {
963
- this.backdrop.style.opacity = String(backdropOpacity);
964
- }
965
- const nextPointer = backdropOpacity > POINTER_EVENTS_OPACITY_THRESHOLD ? "auto" : "none";
966
- if (nextPointer !== this.lastBackdropPointer) {
967
- this.backdrop.style.pointerEvents = nextPointer;
968
- this.lastBackdropPointer = nextPointer;
959
+ if (this.isTopSheet() || backdropOpacity === 0) {
960
+ if (this.backdropOpacitySentinel.shouldWrite(
961
+ backdropOpacity,
962
+ OPACITY_WRITE_EPSILON
963
+ )) {
964
+ this.backdrop.style.opacity = String(backdropOpacity);
965
+ }
966
+ const nextPointer = backdropOpacity > POINTER_EVENTS_OPACITY_THRESHOLD ? "auto" : "none";
967
+ if (nextPointer !== this.lastBackdropPointer) {
968
+ this.backdrop.style.pointerEvents = nextPointer;
969
+ this.lastBackdropPointer = nextPointer;
970
+ }
969
971
  }
970
972
  }
971
973
  if (this.screenComponent && this.scrimMode !== "off") {