jonesjones
jonesjones

Reputation: 497

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.

Upvotes: 7

Views: 1396

Answers (1)

autodavid
autodavid

Reputation: 151

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

Upvotes: 1

Related Questions