blob: 03158320e03f84c7e9bb1a32f71415dcd292479d (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 | <header><h1>virtualkeyboardpolicy</h1></header><div class="section-content">
<div class="notecard experimental" id="sect1"><p><strong>Experimental:</strong> <strong>This is an <a href="https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental">experimental technology</a></strong><br>Check the <a href="#browser_compatibility">Browser compatibility table</a> carefully before using this in production.</p></div> <p>The <code>virtualkeyboardpolicy</code> <a href="../global_attributes">global attribute</a> is an enumerated attribute. When specified on an element that also uses the <a href="../global_attributes#contenteditable"><code>contenteditable</code></a> attribute, it controls the on-screen virtual keyboard behavior on devices such as tablets, mobile phones, or other devices where a hardware keyboard may not be available.</p> <p>The attribute must take one of the following values:</p> <ul> <li>
<code>auto</code> or an <em>empty string</em>, which automatically shows the virtual keyboard when the element is focused or tapped.</li> <li>
<code>manual</code>, which decouples focus and tap on the element from the virtual keyboard's state.</li> </ul>
</div>
<h2 id="specifications">Specifications</h2>
<div class="_table"><table class="standard-table">
<thead><tr><th scope="col">Specification</th></tr></thead>
<tbody><tr><td><a href="https://w3c.github.io/virtual-keyboard/#dom-elementcontenteditable-virtualkeyboardpolicy">VirtualKeyboard API <br><small># dom-elementcontenteditable-virtualkeyboardpolicy</small></a></td></tr></tbody>
</table></div>
<h2 id="browser_compatibility">Browser compatibility</h2>
<div class="_table"><table>
<thead>
<tr id="bct-browser-type">
<th></th>
<th colspan="6">Desktop</th>
<th colspan="6">Mobile</th>
</tr>
<tr id="bct-browsers">
<th></th>
<th>Chrome</th>
<th>Edge</th>
<th>Firefox</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
<th>WebView Android</th>
<th>Chrome Android</th>
<th>Firefox for Android</th>
<th>Opera Android</th>
<th>Safari on IOS</th>
<th>Samsung Internet</th>
</tr>
</thead>
<tbody><tr>
<th><code>virtualkeyboardpolicy</code></th>
<td class="bc-supports-yes">94</td>
<td class="bc-supports-yes">94</td>
<td class="bc-supports-no">No</td>
<td class="bc-supports-no">No</td>
<td class="bc-supports-yes">80</td>
<td class="bc-supports-no">No</td>
<td class="bc-supports-yes">94</td>
<td class="bc-supports-yes">94</td>
<td class="bc-supports-no">No</td>
<td class="bc-supports-yes">66</td>
<td class="bc-supports-no">No</td>
<td class="bc-supports-yes">17.0</td>
</tr></tbody>
</table></div>
<h2 id="see_also">See also</h2>
<div class="section-content"><ul> <li>All <a href="../global_attributes">global attributes</a>
</li> <li>
<a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable"><code>HTMLElement.contentEditable</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/isContentEditable"><code>HTMLElement.isContentEditable</code></a>
</li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/VirtualKeyboard_API">The VirtualKeyboard API</a></li> </ul></div><div class="_attribution">
  <p class="_attribution-p">
    © 2005–2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br>
    <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/virtualkeyboardpolicy" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/virtualkeyboardpolicy</a>
  </p>
</div>
 |