<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>I completely disagree. The idea that the API doesn't apply because we don't know what is being selected is complete garbage.<br>The select API should be available as a character array or set of indexes selected, and the programmer should be able to interpret what that means. There are many applications that are made <b>much easier</b> to implement with the select API. These examples spring to mind:<br><br><ul><li>web apps where you want to override/change the right-click context menu, but still have the option to "copy" within it. How would you know what to copy? (Hang on- doesn't Google do this with google docs?)<br></li></ul><ul><li>A web-based email client, selecting a username from a list of users you are sending to in the "to" field gives you more details about that person.</li></ul><ul><li>Highlighting an area of the input that fails validation on form submission.</li><li>web-based find next using regex searching</li></ul><br>I agree that you could run into troubles where you don't know whether or not the user is selecting an image within a paragraph could cause issues, but for the input element of type text or textarea, the select API should definately be available.<br><br><br><div>> Date: Wed, 5 Mar 2014 04:01:13 +0000<br>> From: ian@hixie.ch<br>> To: kevinsheedy@gmail.com<br>> CC: help@whatwg.org<br>> Subject: Re: [html5] Select API for inputs of type numer and email.<br>> <br>> On Thu, 27 Feb 2014, Kevin Sheedy wrote:<br>> > <br>> > The Chrome browser recently disabled the *select api* for inputs of type<br>> > number and email:<br>> > https://codereview.chromium.org/100433008/#ps60001<br>> > <br>> > The select api is a collection of attributes and functions that allow us to<br>> > get and set which portion of text a user has highlighted in an <input><br>> > <br>> > The attributes and functions in question are:<br>> > select()<br>> > selectionStart<br>> > selectionEnd<br>> > selectionDirection<br>> > setRangeText()<br>> > setSelectionRange()<br>> > <br>> > This change caused bugs in several libraries:<br>> > <br>> > http://stackoverflow.com/questions/21177489/selectionstart-selectionend-on-input-type-number-no-longer-allowed-in-chrome#<br>> > <br>> > https://github.com/KevinSheedy/jquery.alphanum/issues/19<br>> > <br>> > The spec says that these properties should be available for inputs of <br>> > types* text, search, url, telephone and password* but not for inputs of <br>> > type *number or email.*<br>> > <br>> > I'd like to request that this collection also be made available to <br>> > inputs of type number and email.<br>> > <br>> > Does anyone have any insight as to why these types were excluded?<br>> <br>> There's been some discussion of this here:<br>> <br>>    https://www.w3.org/Bugs/Public/show_bug.cgi?id=24796<br>> <br>> The short answer is that the selection APIs don't apply here because <br>> there's no way to know what you're going to be selecting. If the value is <br>> "123456", and you select characters 1 through 4, what is selected?<br>> <br>> Is it "1[23,4]56" ? (square brackets showing selection)<br>> <br>> Is it "O[ne h]undred and twenty three thousand, four hundred and fifty <br>> six"?<br>> <br>> Is it "0[00'1]23'456" ?<br>> <br>> Is it "1[.234]56e5" ?<br>> <br>> All of these are valid things for the browser to be showing in a numeric <br>> field. Indeed, the browser could also show them as even more elaborate <br>> controls, say as:<br>> <br>>  [+] ..... ..... ..... ..... ..... ..... .....<br>>      |   | | 0 | | 1 | | 2 | | 3 | | 4 | | 5 |<br>>   >> |   | | 1 | | 2 | | 3 | | 4 | | 5 | | 6 | <<<br>>      |   | | 2 | | 3 | | 4 | | 5 | | 6 | | 7 |<br>>      ''''' ''''' ''''' ''''' ''''' ''''' ''''' [.]<br>> <br>> ...or as:<br>> <br>>   0                100k              200k<br>>   |----------------------v-------------|<br>>                       123,456<br>> <br>> How would you select anything there?<br>> <br>> This is why the API doesn't apply.<br>> <br>> So far, the use cases revolve mostly around doing things that shouldn't be <br>> necessary, like doing a fake JS-based keyboard for kiosks, instead of <br>> using native kiosk soft-keyboards provided by the OS. These really aren't <br>> use cases that make sense for the Web -- the whole point of the Web's <br>> design is that if you want a special input mode, like a software keyboard, <br>> you provide that at the user agent (browser) level, not in the page.<br>> <br>> -- <br>> Ian Hickson               U+1047E                )\._.,--....,'``.    fL<br>> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.<br>> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'<br>> _______________________________________________<br>> Help mailing list<br>> Help@lists.whatwg.org<br>> http://lists.whatwg.org/listinfo.cgi/help-whatwg.org<br></div>                                       </div></body>
</html>