-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
The showLoading and showUndo functions somewhat "ignore" isHTML = true, because they don't simply pass the text argument to showMessage, which itself just forwards it to Toastify, but they create a new element and set its innerText property to the value of text and then pass the whole element to showMessage.
nextcloud-dialogs/lib/toast.ts
Lines 213 to 223 in c32717e
| const loaderContent = document.createElement('span') | |
| loaderContent.classList.add('toast-loader-container') | |
| loaderContent.innerText = text | |
| loaderContent.appendChild(loader) | |
| return showMessage(loaderContent, { | |
| ...options, | |
| close: false, | |
| timeout: TOAST_PERMANENT_TIMEOUT, | |
| type: ToastType.LOADING, | |
| }) |
I think it would be fine to do
const loaderContent = document.createElement('div')
loaderContent[options.isHTML ? 'innerHTML' : 'innerText'] = textThe containers are flex containers, so I think it won't be a problem
nextcloud-dialogs/styles/toast.scss
Lines 23 to 28 in c32717e
| .toast-loader-container, | |
| .toast-undo-container { | |
| display: flex; | |
| align-items: center; | |
| width: 100%; | |
| } |
If you don't want to change this, I think it would be a good idea to at least remove isHTML from the options
export function showLoading(text: string, options?: Omit<ToastOptions, 'isHTML'>): Toast { }Metadata
Metadata
Assignees
Labels
No labels