-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dropdown): add keyboard navigation support (#2683)
Allow opening dropdown and navigate between items marked with `ngbDropdownItem` using keyboard arrow keys.
- Loading branch information
1 parent
aeb39aa
commit 6608487
Showing
11 changed files
with
437 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
demo/src/app/components/dropdown/demos/form/dropdown-form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="row"> | ||
<div class="col"> | ||
<div ngbDropdown class="d-inline-block" autoClose="outside"> | ||
<button class="btn btn-outline-primary" id="dropdownForm1" ngbDropdownToggle>Toggle dropdown</button> | ||
<div ngbDropdownMenu aria-labelledby="dropdownForm1"> | ||
<form class="px-4 py-3"> | ||
<div class="form-group"> | ||
<label for="exampleDropdownFormEmail1">Email address</label> | ||
<input type="email" class="form-control" id="exampleDropdownFormEmail1" placeholder="email@example.com"> | ||
</div> | ||
<div class="form-group"> | ||
<label for="exampleDropdownFormPassword1">Password</label> | ||
<input type="password" class="form-control" id="exampleDropdownFormPassword1" placeholder="Password"> | ||
</div> | ||
<div class="form-check"> | ||
<input type="checkbox" class="form-check-input" id="dropdownCheck"> | ||
<label class="form-check-label" for="dropdownCheck"> | ||
Remember me | ||
</label> | ||
</div> | ||
<button type="submit" class="btn btn-primary">Sign in</button> | ||
</form> | ||
<div class="dropdown-divider"></div> | ||
<button ngbDropdownItem>New around here? Sign up</button> | ||
<button ngbDropdownItem>Forgot password?</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'ngbd-dropdown-form', | ||
templateUrl: './dropdown-form.html' | ||
}) | ||
export class NgbdDropdownForm { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.