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

feat(timepicker) - add keyboard navigation #1007

Closed
nadavten opened this issue Sep 20, 2016 · 7 comments
Closed

feat(timepicker) - add keyboard navigation #1007

nadavten opened this issue Sep 20, 2016 · 7 comments

Comments

@nadavten
Copy link

bug

timer - arrowKeys not working.

and i dont see the arrows (up and down) for each input of hour:minutes

@zacharybil
Copy link

zacharybil commented Oct 3, 2016

Setting [arrowkeys]="false" doesn't seem to change any behavior for me either.

Are you sure you don't have [showSpinners]="false"? That removes the up down arrow chevrons.

@nadavten
Copy link
Author

nadavten commented Oct 4, 2016

Im sure

On Mon, Oct 3, 2016, 23:43 Zachary Billington notifications@github.com
wrote:

Setting [arrowkeys]="false" doesn't seem to change any behavior for me
either.

Are you sure you don't [showSpinners]="false"? That removes the up down
arrow chevrons.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1007 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQ-rrFThv6nMUZZU8B3rnAP6nfi4XHNBks5qwWjlgaJpZM4KCIfH
.

@valorkin valorkin changed the title timer - arrowKeys not working feat(timepicker) - add keyboard navigation Oct 13, 2016
@SystemDisc
Copy link

SystemDisc commented Jan 19, 2017

Pressing the arrow keys on my Macbook Air (macOS Sierra) in the latest Chrome does not change the value in the timepicker, even if I explicitly state [arrowkeys]="true". It does not work on the demo page for me, either: https://valor-software.com/ng2-bootstrap/#/timepicker

@SystemDisc
Copy link

It may be that pressing up by default puts the cursor at the beginning of the input and down puts it at the end. Perhaps you need to e.preventDefault();

@rishuvaid
Copy link

'arrowkeys' property is not working for me either. Is it fixed yet? or is there something I may be missing?

@SystemDisc
Copy link

SystemDisc commented Mar 16, 2017

It's still not working.

I ended up putting a hacky jQuery script in a plain JS file that I link to in my header.

$(function() {
	$(document).on('keydown', 'timepicker input[type=text], timepicker button', function(e) {
		if (e.keyCode === 38 || e.keyCode === 40) {
			e.preventDefault();
			e.stopPropagation();
			let $this = $(e.currentTarget);
			let index = $this.closest('td').index();
			if ($this.is(':not(button)')) {
				if (e.keyCode === 38) {
					$this.closest('table').find('tr').first().find('td:nth-child(' + (index + 1) + ') a > *').first().click();
				}
				else {
					$this.closest('table').find('tr').last().find('td:nth-child(' + (index + 1) + ') a > *').first().click();
				}
			}
			else {
				$this.click();
			}
		}
	});
});

This works even with the buttons hidden.

@artemvfrolov artemvfrolov mentioned this issue Jun 15, 2017
valorkin added a commit that referenced this issue Jul 19, 2017
fixes #2036
fixes #1981 ( + min max demo )
fixes #1973
close #1957 ( + seconds demo )
fixes #1935
fixes #1672
feat #1007 added keyboard and mousewheel support
fixes #962
fixes #793
fixes #173
fixes #1271 added custom validation demo
fixes #1539 bs4
fixes #1253 if input is invalid

* feat(timepicker): new timepicker implementation

* feat(timepicker): new timepicker implementation testing

* chore(timepicker): removed old timepicker implementation

* chore(mini-ngrx): added ngrx licence

* fix(timepicker): fix seconds

* fix(timepicker): fix custom validation demo

* fix(tests): fix tests & aot errors

* fix(timepicker): min max restrictions

* fix(timepicker): min max checks

* feat(timepicker): add inputs validation (#2187)

* feat(timepicker): add inputs validation

* fix(timepicker): add isPM support

* feat(timepicker): add isValid output

* feat(timepicker): added test plan (#2127)

* fix(timepicker): fix ngModelChange demo

* fix(test): fix unit tests

* docs(timepicker): fix docs conflict, add isValid description
@IlyaSurmay
Copy link
Contributor

fixed in #2058

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

No branches or pull requests

6 participants