Comments (5)
Hello, thank you for reporting this bug. It has been fixed in v4.11.0.
Also to access the source maps, use a specific version in your script tag, for example =>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/typeahead-standalone.js">
The will ensure that the source-maps load correctly (https://cdn.jsdelivr.net/npm/[email protected]/dist/typeahead-standalone.js.map)
Thanks again!
from typeahead-standalone.
I think you can handle pretty much all use cases with the config callback property display
:
display: (selectedItem, evt) => {
if (evt && evt.type === 'click') {
// submit form here
}
// if tab should not replace the input value with item.property
return (evt && evt.key === 'Tab') ? evt.target.value : item.property;
}
from typeahead-standalone.
also i get an following error
DevTools failed to load source map: Could not load content for https://cdn.jsdelivr.net/npm/typeahead-standalone.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
from typeahead-standalone.
Hey @niketpathak the issue still persists for me when preventSubmit: false
.
I might be wrong here, but according to my understanding, if I click on the username it should trigger the onSubmit function. With the keys it triggers as intended, but on using mouse click, it fills in the data in the form, but I don't receive data on my console log. I've updated the code https://codepen.io/webVerts/pen/vYjNEGm
from typeahead-standalone.
Hey @webVerts ,
This is intended behavior. When you select a suggestion via your Keyboard(Arrow keys) and press the Tab key,
the behavior is similar to what would happen when you click on a suggestion. This is because you are only selecting a suggestion, but not submitting it, hence the onSubmit
callback is not executed.
The onSubmit
callback is used to submit data when the input element is used outside of a form. It therefore gets executed only when you hit the Enter key. For example, when you select a suggestion by clicking on it, the input element will be filled with the necessary text. And then when you hit Enter, the onSubmit
callback will be executed.
I think what you are looking for is an onSelect
callback which does not exist yet. If you could kindly elaborate on the use-case of why this callback would be useful/necessary, we will definitely include it in the next release. Thanks!
from typeahead-standalone.
Related Issues (20)
- Moving instead of cloning changes order of elements in parent element HOT 1
- Arrow key does not always select an item from the list. HOT 1
- Display callback is called for every item in the suggestion list instead of only once HOT 3
- mouse hover and keyboard select design conflict HOT 2
- With hint: false, a tt-hint input box is still generated HOT 3
- using with webpack 4.46.0 HOT 5
- Not displaying suggestions within Bootstrap offcanvas on Firefox HOT 5
- typeahead does not respect remote data source order HOT 2
- Generated HTML is not valid HOT 3
- Conflict issue on submitting data on Firefox Mobile devices HOT 11
- Typeahead import with Vite fails in production mode HOT 1
- Native Input Event Not Being Triggered HOT 4
- Error when using vite in production HOT 9
- Access `input` within url callback for remote source
- Data Not being submitted on Chrome Android HOT 1
- cannot keydown through defaultItems in empty resultSet HOT 1
- Webpack build fails in 4.25.0 HOT 2
- error using with typescript HOT 4
- typeahead-standalone wont scroll result content using bootstrap 5 offcanvas component HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typeahead-standalone.