Maybe I'm missing something because I couldn't find any past issues about it and I feel like this would be commonly used. Any help is appreciated. Sorry if its not a real bug.
getActionFromEvent(event) in MDCDialog's adapter returns null.
MDCDialog.foundation_.adapter_.getActionFromEvent(event) returns null.
MDCDialog.foundation_.adapter_.getActionFromEvent(event) returns the event.detail.action.
| Software | Version(s) |
| ---------------- | ---------- |
| MDC Web | 3.2.0
| Browser | Chrome
| Operating System | Windows 10
HTML:
<div class="mdc-dialog" role="alertdialog" aria-modal="true">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<h2 class="mdc-dialog__title" id="my-dialog-title"></h2>
<div class="mdc-dialog__content" id="my-dialog-content"></div>
<footer class="mdc-dialog__actions">
<button type="button" class="mdc-button mdc-dialog__button" data-mdc-dialog-action="close">
<span class="mdc-button__label">Cancel</span>
</button>
<button type="button" class="mdc-button mdc-dialog__button" data-mdc-dialog-action="confirm">
<span class="mdc-button__label">Confirm</span>
</button>
</footer>
</div>
</div>
<div class="mdc-dialog__scrim"></div>
</div>
JS:
$('.mdc-dialog').one('MDCDialog:closed', (event) => {
console.log(JSON.stringify(event.detail)); //returns {"action":"confirm"}
console.log(event.detail.action); // returns confirm
console.log(mdcDialog.foundation_.adapter_.getActionFromEvent(event)); //returns null
});
Hi, adapter methods are not meant to be used publicly. Is there a use case where this is called within the component and returning null?
Most helpful comment
Hi, adapter methods are not meant to be used publicly. Is there a use case where this is called within the component and returning null?