The Wayback Machine - https://web.archive.org/web/20201221153158/https://github.com/github/remote-input-element/releases
Skip to content

@keithamus keithamus released this Mar 19, 2020

  • fix: output umd build for main key #19

v0.3.0...v0.3.1

Assets 2

@koddsson koddsson released this Mar 11, 2020

  • Remove text/html; fragment from accept header (#22)

v0.2.1...v0.3.0

Assets 2

@koddsson koddsson released this Jan 29, 2020

  • Accept text/fragment+html as a content-type (#21)

github/auto-complete-element@v0.2.0...v0.2.1

Assets 2

@dgraham dgraham released this Oct 22, 2019

  • Replace Flow + Babel toolchain with TypeScript #15
  • Remove private state from public API #16
  • Abort in-flight requests #17
Assets 2

@muan muan released this Sep 20, 2019

  • Fixed parsing for relative URL in src #13
Assets 2

@keithamus keithamus released this Sep 12, 2019

v0.1.0...v0.1.1

Assets 2

@muan muan released this Sep 10, 2019

  • Fixed #10 via #11: Only append response text if the response was successful.
  • Added new events:
    • remote-input-success: fired when response is successful and HTML is set.
    • remote-input-error: fired when response is not successful.
Assets 2
  • 0.0.7
  • b24d7b5
  • Compare
    Choose a tag to compare
    Search for a tag
  • 0.0.7
  • b24d7b5
  • Compare
    Choose a tag to compare
    Search for a tag

@koddsson koddsson released this Aug 14, 2019

<remote-input> element

An input element that sends its value to a server endpoint and renders the response body.

Installation

$ npm install @github/remote-input-element

Usage

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>

Styling loading state

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; }

Events

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)
})

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

Assets 2

@koddsson koddsson released this Aug 14, 2019

  • Merge pull request #8 from github/publish-to-gpr-as-well b24d7b5
  • publish to GPR as a postpublish step 7923480

v0.0.6...v0.0.7

Assets 2

@koddsson koddsson released this Jul 31, 2019

  • Merge pull request #7 from github/dependabot/npm_and_yarn/lodash-4.17.15 31dcc69
  • Bump lodash from 4.17.11 to 4.17.15 7597d7f

v0.0.5...v0.0.6

Assets 2
You can’t perform that action at this time.