LWC Modal template minor corrections
Issue #2302
resolved
- The file template’s import statement uses
{LightningModal}
when it should use the default import as in the docs:import LightningModal from 'lightning/modal';
- The embedded Typescript stubs need
default
added to the definition as a result (i.e.export default class
) - Although the docs specify it doesn’t extend
LightningElement
, looking at the code in Debug mode, it actually does indirectly (vialightning/overlay
). Things likedispatchEvent
(in the docs) andthis.template
definitely work - The
open
method should probably returnPromise<any>
as it will return whatever was given toclose
Comments (2)
-
repo owner -
repo owner - changed status to resolved
The items described in my previous response have been delivered in 2.2.5.3.
- Log in to comment
Thanks, Xander. I’ve addressed 1, 2, and 4 for the next build. I’m hesitant to make
LightningModal
extendLightningElement
since it’s explicitly documented not to do so. I’d prefer to chat with the LWC folks to understand why it seems that way in spite of the documentation before changing the declaration to reflect such a relationship.