Skip to content

Instantly share code, notes, and snippets.

@AshleyGrant
Last active September 6, 2017 17:59
Show Gist options
  • Save AshleyGrant/c90d604b2bd81a00ca956c17191ead94 to your computer and use it in GitHub Desktop.
Save AshleyGrant/c90d604b2bd81a00ca956c17191ead94 to your computer and use it in GitHub Desktop.
Aurelia Focus Bug?
<template>
<div>
<input type="text" focus.trigger="showFirst = true" />
<div show.bind="showFirst">Here I am!</div>
</div>
<br />
<div>
<input type="text" focus.trigger="showSecond = true" />
<div show.bind="showSecond">Here I am!</div>
</div>
</template>
export class App {
name: 'Ashley';
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css">
<link rel="stylesheet" href="https://mottie.github.io/Keyboard/css/keyboard.css">
<script src="https://mottie.github.io/Keyboard/js/jquery.keyboard.js"></script>
<script src="https://mottie.github.io/Keyboard/js/jquery.mousewheel.js"></script>
<script src="https://mottie.github.io/Keyboard/js/jquery.keyboard.extension-typing.js"></script>
</head>
<body aurelia-app>
<h1>Loading...</h1>
<script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/config.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script>
<script>
require(['aurelia-bootstrapper']);
</script>
</body>
</html>
import {inject} from 'aurelia-framework';
@inject(Element)
export class KeyboardCustomAttribute {
constructor(el) {
this.el = el;
}
attached() {
$(this.el).keyboard({
layout: 'qwerty'
})
// activate the typing extension
.addTyping({
showTyping: true,
delay: 250
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment