mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
chore(): sync with main
This commit is contained in:
@ -188,10 +188,20 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { message, spinner, htmlAttributes } = this;
|
||||
const { message, spinner, htmlAttributes, overlayIndex } = this;
|
||||
const mode = getIonMode(this);
|
||||
const msgId = `loading-${overlayIndex}-msg`;
|
||||
/**
|
||||
* If the message is defined, use that as the label.
|
||||
* Otherwise, don't set aria-labelledby.
|
||||
*/
|
||||
const ariaLabelledBy = message !== undefined ? msgId : null;
|
||||
|
||||
return (
|
||||
<Host
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby={ariaLabelledBy}
|
||||
tabindex="-1"
|
||||
{...(htmlAttributes as any)}
|
||||
style={{
|
||||
@ -209,14 +219,16 @@ export class Loading implements ComponentInterface, OverlayInterface {
|
||||
|
||||
<div tabindex="0"></div>
|
||||
|
||||
<div class="loading-wrapper ion-overlay-wrapper" role="dialog">
|
||||
<div class="loading-wrapper ion-overlay-wrapper">
|
||||
{spinner && (
|
||||
<div class="loading-spinner">
|
||||
<ion-spinner name={spinner} aria-hidden="true" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{message !== undefined && <div class="loading-content" innerHTML={sanitizeDOMString(message)}></div>}
|
||||
{message !== undefined && (
|
||||
<div class="loading-content" id={msgId} innerHTML={sanitizeDOMString(message)}></div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div tabindex="0"></div>
|
||||
|
||||
Reference in New Issue
Block a user