Package Exports
- be-committed/be-committed.js
Readme
be-committed
be-committed encapsulates and makes declarative a snippet of code that is likely found frequently in various web sites. In particular, trigger a button click on keyboard "enter."
Syntax
<label for=url>Enter Url</label>
<input id=url be-committed='{"to": "change"}'>
<button id=change>Search</button>
<script type=module crossorigin>
import 'https://esm.run/be-committed';
</script>Referencing the module, as shown above, only affects input elements outside any ShadowDOM realm.
To affect elements within a ShadowDOM realm, add an instance the tag "be-hive" within the ShadowDOM realm.
What this does:
If you set focus on the input element, start typing, and click enter, it clicks on the "Search" button.
CDN
<script type=module>
import 'https://esm.run/be-committed'
</script>Running locally
- Do a git clone or a git fork of repository https://github.com/bahrus/be-committed
- Install node.js
- Run "npm install" from location of folder created in step 1.
- Run npm run serve. Open browser to http://localhost:3030/demo/
Using from ESM Module:
import 'be-committed/be-committed.js';Using from CDN:
<script type=module crossorigin=anonymous>
import 'https://esm.run/be-committed';
</script>