Skip to content

Commit

Permalink
fix: modify some default-true properties
Browse files Browse the repository at this point in the history
  • Loading branch information
FriedRiceNoodles committed Feb 20, 2024
1 parent 976fa87 commit 8b74d8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions packages/banana/src/carousel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ export default class BCarousel extends LitElement {
@property({ type: Number, reflect: true, attribute: 'autoplay-delay' })
autoplayDelay = 3000;

@property({ type: Boolean, reflect: true, attribute: 'pause-on-mouse-enter' })
pauseOnMouseEnter = true;
// Caraousel will pause when mouse enter by default.
@property({ type: Boolean, reflect: true, attribute: 'no-pause-on-mouse-enter' })
noPauseOnMouseEnter = false;

@property({ type: Boolean, reflect: true, attribute: 'disable-drag' })
disableDrag = false;
Expand Down Expand Up @@ -445,13 +446,13 @@ export default class BCarousel extends LitElement {
}

private _onWrapperMouseEnter() {
if (this.pauseOnMouseEnter) {
if (!this.noPauseOnMouseEnter) {
this._clearAutoplayTimer();
}
}

private _onWrapperMouseLeave() {
if (this.pauseOnMouseEnter) {
if (!this.noPauseOnMouseEnter) {
this._setAutoplayTimer();
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/banana/src/dropdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export default class BDropdown extends LitElement {
@property({ reflect: true })
placement: Placement = 'bottomLeft';

@property({ type: Boolean, reflect: true, attribute: 'auto-adjust-overflow' })
autoAdjustOverflow = true;
@property({ type: Boolean, reflect: true, attribute: 'no-auto-adjust-overflow' })
noAutoAdjustOverflow = false;

@property({ reflect: true, attribute: 'trigger-action' })
triggerAction: 'hover' | 'click' = 'hover';
Expand All @@ -72,7 +72,7 @@ export default class BDropdown extends LitElement {
if (!this._trigger || !this._content) return;

const middleware: ComputePositionConfig['middleware'] = [offset(this.margin)];
if (this.autoAdjustOverflow) middleware.push(flip());
if (!this.noAutoAdjustOverflow) middleware.push(flip());
if (this._arrowElements[0] !== undefined) middleware.push(arrow({ element: this._arrowElements[0] }));

void computePosition(this._trigger, this._content, {
Expand Down

0 comments on commit 8b74d8b

Please sign in to comment.