Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]? Using TdChips and TdFileUpload together causes wrong keyup.enter events to be fired #210

Closed
asaph26 opened this issue Dec 27, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@asaph26
Copy link
Contributor

asaph26 commented Dec 27, 2016

Currently using TdChips and TdFileUpload in the same page causes some interesting behaviour

Chips:
To select a chip when using autocomplete, the enter key is needed to select a chip and also to remove chips. the code is in the following places
https://github.com/Teradata/covalent/blob/develop/src/platform/core/chips/autocomplete/autocomplete.component.html#L15
https://github.com/Teradata/covalent/blob/develop/src/platform/core/chips/chips.component.html#L7

File Upload
The file upload Component also uses the enter key to initiate the file selection process. The code is present here
https://github.com/Teradata/covalent/blob/develop/src/platform/core/file/file-upload.component.html#L7

When using AutoComplete, if the overlay with options is not in focus when the enter key is pressed, it triggers the file browse. The browsers Auto-complete overlay is also present causing it to occur rather frequently

Possible Solution Suggestions

@emoralesb05
Copy link
Contributor

emoralesb05 commented Dec 27, 2016

I think this happens because they are used inside a form, so when you press enter anywhere, the form wants to send an event to the first focusable button in the form. (HTML5 form submit native functionality)

The fix would be to add type="button" in those buttons (inside the components), so the form doesnt assume they are type="submit"

Gonna test it.

@kyleledbetter
Copy link
Contributor

fixed in #216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants