fix: Added backspace button on Super toolbar on Android as a workaround for backspace issue

This commit is contained in:
Aman Harwara
2023-03-30 00:35:55 +05:30
parent c3a5b249b2
commit 08a20e25b4
5 changed files with 80 additions and 13 deletions

View File

@@ -41,7 +41,7 @@ const getColorsForPrimaryVariant = (style: AlertButtonStyle) => {
type AlertButton = {
text: string
style: AlertButtonStyle
action: () => void
action?: () => void
primary?: boolean
}
@@ -168,7 +168,9 @@ export class SKAlert {
this.buttons.forEach((buttonDesc, index) => {
const buttonElem = this.element.querySelector(`#button-${index}`) as HTMLButtonElement
buttonElem.onclick = () => {
buttonDesc.action && buttonDesc.action()
if (buttonDesc.action) {
buttonDesc.action()
}
this.dismiss()
}
if (index === 0) {