Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the keyboard return key in WKWebView

I have the following page I'm displaying in WkWebView

<html>
  <textarea name='message' placeholder='Type your message here'/>
</html>

And when entering text to this field, the keyboard displays a normal "Return" key.

I would like to change the label of the return key to "Send" just for this field.

Is that possible in WKWebView?

I'm aware of this answer: How to change keyboard button "Return" to "Search" for input in a UIWebView? But the proposed solution only works in UIWebView.

like image 430
jonesjones Avatar asked Nov 20 '22 12:11

jonesjones


1 Answers

For someone who is still looking for the answer, we have html enterkeyhint property nowadays: MDN.

<input id="send" enterkeyhint="send" />

<!— or —>

<textarea enterkeyhint="send"></textarea>

Most of the enterkeyhint values (enter/done/go/next/previous/search/send) have their iOS UIReturnKeyType counterparts, and the return key changes to the corresponding appearance.

Send Key Example

like image 125
autodavid Avatar answered Nov 22 '22 02:11

autodavid