Skip to content

Dialog width #148

@bmdietrich

Description

@bmdietrich

Is there a simple way to adjust dialog widths on a per dialog basis? Right now, we're adjusting a custom dialog using the following method...

`changeWidth() {

setTimeout(() => {
  let dialogEls = document.getElementsByClassName('mdl-dialog');
  let elements = Array.prototype.filter.call(dialogEls, (dialogEl) => {
    if (dialogEl.nodeName === 'MDL-DIALOG-HOST-COMPONENT') {
      let hostComp = dialogEl.lastChild;
      if ((hostComp || {}).nodeName === 'CUSTOM-DIALOG-CMP') {
        return true;
      }
    }
  })
  elements.forEach(el => {
    el.style.width = '500px';
  });
});

}`

We're looking for a cleaner option. Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions