Re: [w3ctag/design-reviews] HTMLInputElement showPicker() (Issue #688)

Rejecting the `showPicker()` promise with `NotSupportedError ` may help with whether picker was shown or not. What do you think @domenic?

```js
if ("showPicker" in HTMLInputElement.prototype) {
  try {
    await document.querySelector("input").showPicker();
  }
  catch (error) {
    if (error == "NotSupportedError") {
      /* Show custom picker */
    }
  }
} else {
  /* Show custom picker */
}


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/688#issuecomment-993763531

Received on Tuesday, 14 December 2021 16:52:02 UTC