capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

feat: [android] remove default titles from `JsAlert`, `JsConfirm` and `JsPrompt`

Open tafelnl opened this issue 4 years ago • 0 comments

Feature Request

Description

The following code:

alert('Something to alert')

results in an alert like this: image

Mind the "Alert" title. I do not think it makes sense to show that title here. I know that custom alerts are already supported by Capacitor. But I still think 'normal' alerts should also be allowed and be shown without a title.

Platform(s)

Android

Preferred Solution

Remove the titles from JsAlert, JsConfirm and JsPrompt so it will be shown like this:

image

This can be achieved by removing the following lines:

  • https://github.com/ionic-team/capacitor/blob/883c0fe4a8a33d2e14894d9b307f4d7ce6d13bad/android/capacitor/src/main/java/com/getcapacitor/BridgeWebChromeClient.java#L145
  • https://github.com/ionic-team/capacitor/blob/883c0fe4a8a33d2e14894d9b307f4d7ce6d13bad/android/capacitor/src/main/java/com/getcapacitor/BridgeWebChromeClient.java#L185
  • https://github.com/ionic-team/capacitor/blob/883c0fe4a8a33d2e14894d9b307f4d7ce6d13bad/android/capacitor/src/main/java/com/getcapacitor/BridgeWebChromeClient.java#L234

tafelnl avatar Jun 18 '21 09:06 tafelnl