Sha256: 650fa864061338052388da55541b4b33cf884b79eca2f673347d92b17a6aac2d

Contents?: true

Size: 1.69 KB

Versions: 2

Compression:

Stored size: 1.69 KB

Contents

<!DOCTYPE html>
<html>
<meta charset='utf-8'>
<head>
<script src="../dialog-polyfill.js"></script>
<meta name="viewport" content="width=device-width, user-scalable=no">
<link rel="stylesheet" type="text/css" href="../dialog-polyfill.css">
<style>
dialog {
  width: 100px;
}
</style>
</head>
<body>
<p>Test for modal dialog. The test passes if you can click on "Click me" button,
but can't click or tab to the "Can't click me!" button</p>
<div id="console"></div>

<input type="text" placeholder="Test 1" tabindex="1" />
<input type="text" placeholder="Test 2" tabindex="2" />
<input type="text" placeholder="Test 2.1" tabindex="2" />
<input type="text" placeholder="Test 3" tabindex="3" />

<input type="text" placeholder="Before dialog" />
<dialog>
  <button id="dialog-button">Click me</button>
  <input type="text" placeholder="Focus me" />
  <input type="text" placeholder="Focus me again" />
</dialog>
<button id="inert-button">Can't click me</button>
<input type="text" placeholder="Can't focus me" />
<script>
function writeToConsole(s) {
  var console = document.getElementById('console');
  var span = document.createElement('span');
  span.textContent = s;
  console.appendChild(span);
  console.appendChild(document.createElement('br'));
}

var dialog = document.querySelector('dialog');
dialogPolyfill.registerDialog(dialog);
dialog.showModal();

var dialogButton = document.getElementById('dialog-button');
dialogButton.addEventListener('click', function(e) {
  writeToConsole("SUCCESS: dialog's button was clicked");
});

var inertButton = document.getElementById('inert-button');
inertButton.addEventListener('click', function(e) {
  writeToConsole('FAIL: inert button was clicked');
});
</script>
</body>
</html>

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
cortex-0.1.3 spec/dummy/node_modules/dialog-polyfill/tests/modal-dialog.html
material-rails-0.1.0 node_modules/dialog-polyfill/tests/modal-dialog.html