Skip to content

Commit

Permalink
fix: Add min-width option on alerts with default value (#863)
Browse files Browse the repository at this point in the history
* fix: Add min-width option on alerts with default value

* Change docs 400px alert min-width to 300px

* Remove minWidth check
  • Loading branch information
jmarkowski authored and MattL75 committed Jun 11, 2019
1 parent d1dca59 commit 536ba06
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Expand Up @@ -14,6 +14,7 @@ export class AlertComponentAsContentExampleComponent {
openFromComponent() {
this.alertService.open(AlertContentComponent, {
type: 'warning',
minWidth: '300px',
mousePersist: true,
duration: 7500,
data: {
Expand Down
3 changes: 3 additions & 0 deletions library/src/lib/alert/alert-utils/alert-config.ts
Expand Up @@ -16,6 +16,9 @@ export class AlertConfig {
/** Width of the alert. */
width?: string = '33vw';

/** Minimum width of the alert. */
minWidth?: string = '300px';

/** Data being injected into the child component or template. */
data?: any;

Expand Down
5 changes: 5 additions & 0 deletions library/src/lib/alert/alert.component.ts
Expand Up @@ -34,6 +34,7 @@ let alertUniqueId: number = 0;
'[attr.aria-labelledby]': 'ariaLabelledBy',
'[attr.aria-label]': 'ariaLabel',
'[style.width]': 'width',
'[style.min-width]': 'minWidth',
'role': 'alert',
'[attr.id]': 'id',
'[@fadeAlertNgIf]': ''
Expand Down Expand Up @@ -85,6 +86,10 @@ export class AlertComponent extends AbstractFdNgxClass implements OnInit, AfterV
@Input()
width: string;

/** Minimum width of the alert. */
@Input()
minWidth: string;

/** Alternative way of passing in a message to the alert. */
@Input()
message: string;
Expand Down

0 comments on commit 536ba06

Please sign in to comment.