kopia lustrzana https://github.com/shoelace-style/shoelace
add guard to show/hide methods
rodzic
ee9ce8a87b
commit
fc5a21f57d
|
@ -74,7 +74,7 @@ export default class SlAlert extends LitElement {
|
|||
|
||||
/** Shows the alert. */
|
||||
async show() {
|
||||
if (!this.hasInitialized) {
|
||||
if (!this.hasInitialized || this.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ export default class SlAlert extends LitElement {
|
|||
|
||||
/** Hides the alert */
|
||||
async hide() {
|
||||
if (!this.hasInitialized) {
|
||||
if (!this.hasInitialized || !this.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ export default class SlDetails extends LitElement {
|
|||
|
||||
/** Shows the alert. */
|
||||
async show() {
|
||||
if (!this.hasInitialized || this.disabled) {
|
||||
if (!this.hasInitialized || this.open || this.disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ export default class SlDetails extends LitElement {
|
|||
/** Hides the alert */
|
||||
async hide() {
|
||||
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
||||
if (!this.hasInitialized || this.disabled) {
|
||||
if (!this.hasInitialized || !this.open || this.disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ export default class SlDialog extends LitElement {
|
|||
|
||||
/** Shows the dialog */
|
||||
async show() {
|
||||
if (!this.hasInitialized) {
|
||||
if (!this.hasInitialized || this.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ export default class SlDialog extends LitElement {
|
|||
|
||||
/** Hides the dialog */
|
||||
async hide() {
|
||||
if (!this.hasInitialized) {
|
||||
if (!this.hasInitialized || !this.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ export default class SlDrawer extends LitElement {
|
|||
|
||||
/** Shows the drawer */
|
||||
async show() {
|
||||
if (!this.hasInitialized) {
|
||||
if (!this.hasInitialized || this.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ export default class SlDrawer extends LitElement {
|
|||
|
||||
/** Hides the drawer */
|
||||
async hide() {
|
||||
if (!this.hasInitialized) {
|
||||
if (!this.hasInitialized || !this.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -332,7 +332,7 @@ export default class SlDropdown extends LitElement {
|
|||
/** Shows the dropdown panel */
|
||||
async show() {
|
||||
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
||||
if (!this.hasInitialized) {
|
||||
if (!this.hasInitialized || this.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ export default class SlDropdown extends LitElement {
|
|||
/** Hides the dropdown panel */
|
||||
async hide() {
|
||||
// Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher
|
||||
if (!this.hasInitialized) {
|
||||
if (!this.hasInitialized || !this.open) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue