Re: [w3ctag/design-reviews] Contact API (#337)

> An `<input type=contact>` would be useful, and would definitely be nice to have alongside the JS API, but it has some restrictions. One which was already mentioned is that it would require an accompanying JS API for feature detection.

It seems like the existing JS idiom for feature-detecting a new input type is to do something like:

```js
  function inputSupportsType(t) {
    let i = document.createElement("input");
    i.setAttribute("type", t);
    return i.type == t;
  }
```

While it's not great, it does seem to work.

> Another is that it's more geared for sharing the user's contact info rather than any contact's info (assuming it's something like how autofill works). Also giving the user control over the shared data would be more difficult.

It seems like the same sorts of picker UI could be used for an `input` that would be used for the Contact Picker API.  Presumably there would need to be an attribute to control what fields of information were sent or something like that, with some "reasonable" default (maybe "email"?).

-- 
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/337#issuecomment-594194961

Received on Tuesday, 3 March 2020 22:06:31 UTC