An input element that sends its value to a server endpoint and renders the response body.
MIT License
Bot releases are hidden (Show)
Full Changelog: https://github.com/github/remote-input-element/compare/v0.3.1...v0.4.0
Published by jonrohan 6 months ago
Full Changelog: https://github.com/github/remote-input-element/compare/v0.3.1...v0.4.0
https://github.com/github/remote-input-element/compare/v0.3.0...v0.3.1
text/html; fragment
from accept header (#22)https://github.com/github/remote-input-element/compare/v0.2.1...v0.3.0
text/fragment+html
as a content-type (#21)https://github.com/github/auto-complete-element/compare/v0.2.0...v0.2.1
Published by dgraham almost 5 years ago
Published by muan about 5 years ago
src
https://github.com/github/remote-input-element/pull/13
https://github.com/github/remote-input-element/compare/v0.1.0...v0.1.1
Published by muan about 5 years ago
remote-input-success
: fired when response is successful and HTML is set.remote-input-error
: fired when response is not successful.https://github.com/github/remote-input-element/compare/v0.0.6...v0.0.7
Published by koddsson about 5 years ago
An input element that sends its value to a server endpoint and renders the response body.
$ npm install @github/remote-input-element
import '@github/remote-input-element'
<!-- Filter a list of items from the server -->
<remote-input src="/query" aria-owns="results">
<input>
</remote-input>
<ul id="results"></ul>
A GET request will be sent to /query?q=${input.value}
.
The parameter name (q
) is customizable with the [param]
attribute:
<!-- Live preview of Markdown -->
<remote-input src="/preview" aria-owns="md-preview" param="body">
<textarea></textarea>
</remote-input>
<div id="md-preview"></div>
A boolean [loading]
attribute is added to <remote-input>
when a network request begins and removed when it ends.
.loading-icon { display: none; }
remote-input[loading] .loading-icon { display: inline; }
const remoteInput = document.querySelector('remote-input')
// Network request lifecycle events.
remoteInput.addEventListener('loadstart', function(event) {
console.log('Network request started', event)
})
remoteInput.addEventListener('loadend', function(event) {
console.log('Network request complete', event)
})
remoteInput.addEventListener('load', function(event) {
console.log('Network request succeeded', event)
})
remoteInput.addEventListener('error', function(event) {
console.log('Network request failed', event)
})
Browsers without native custom element support require a polyfill.
npm install
npm test
Distributed under the MIT license. See LICENSE for details.
https://github.com/github/remote-input-element/compare/v0.0.5...v0.0.6
https://github.com/github/remote-input-element/compare/v0.0.4...v0.0.5
npm update
065da1ahttps://github.com/github/remote-input-element/compare/v0.0.3...v0.0.4