Skip to content

Commit

Permalink
Utility Panel: Content is not pushed in the default expanded state (#…
Browse files Browse the repository at this point in the history
…3063)

* 3061 - push content initialization

* 3061 - build fixes
  • Loading branch information
prashanthr6383 authored Dec 12, 2024
1 parent f999a3b commit 3c9fd25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('modus-utility-panel', () => {
expect(root).toEqualHtml(`
<modus-utility-panel>
<mock:shadow-root>
<div class="overlay utility-panel">
<div class="utility-panel">
<div class="panel-content">
<div aria-labelledby="body" class="panel-body">
<slot name="body"></slot>
Expand All @@ -31,7 +31,7 @@ describe('modus-utility-panel', () => {
expect(root).toEqualHtml(`
<modus-utility-panel expanded="true">
<mock:shadow-root>
<div class="open overlay utility-panel">
<div class="open utility-panel">
<div class="panel-content">
<div aria-labelledby="body" class="panel-body">
<slot name="body"></slot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class ModusUtilityPanel {
@Prop() expanded = false;

/** Determines if the panel pushes content or displays an overlay. */
@Prop() pushContent = false;
@Prop() pushContent = true;

@Prop() targetContent: string;

Expand All @@ -23,6 +23,12 @@ export class ModusUtilityPanel {

@Element() el: HTMLElement;

componentDidLoad() {
if (this.pushContent) {
this.adjustContent();
}
}

@Watch('expanded')
handleExpandedChange(newValue: boolean) {
if (newValue) {
Expand Down

0 comments on commit 3c9fd25

Please sign in to comment.