Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paragon
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
paragon
Commits
a7f8a8d2
Commit
a7f8a8d2
authored
Jun 23, 2017
by
Ari Rizzitano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better focus management
parent
679d701e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
2 deletions
+7
-2
dist/Dropdown.js
+0
-0
dist/Dropdown.js.map
+0
-0
src/Button.jsx
+4
-0
src/Dropdown.jsx
+3
-2
No files found.
dist/Dropdown.js
View file @
a7f8a8d2
This diff is collapsed.
Click to expand it.
dist/Dropdown.js.map
View file @
a7f8a8d2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/Button.jsx
View file @
a7f8a8d2
...
@@ -23,6 +23,8 @@ function Button(props) {
...
@@ -23,6 +23,8 @@ function Button(props) {
onClick=
{
props
.
onClick
}
onClick=
{
props
.
onClick
}
onKeyDown=
{
props
.
onKeyDown
}
onKeyDown=
{
props
.
onKeyDown
}
type=
{
props
.
type
}
type=
{
props
.
type
}
ref=
{
props
.
inputRef
}
{
...
props
}
>
>
{
props
.
display
}
{
props
.
display
}
</
button
>
</
button
>
...
@@ -33,6 +35,7 @@ Button.propTypes = {
...
@@ -33,6 +35,7 @@ Button.propTypes = {
buttonType
:
PropTypes
.
string
,
buttonType
:
PropTypes
.
string
,
classNames
:
PropTypes
.
arrayOf
(
PropTypes
.
string
),
classNames
:
PropTypes
.
arrayOf
(
PropTypes
.
string
),
display
:
PropTypes
.
string
.
isRequired
,
display
:
PropTypes
.
string
.
isRequired
,
inputRef
:
PropTypes
.
func
,
onBlur
:
PropTypes
.
func
,
onBlur
:
PropTypes
.
func
,
onClick
:
PropTypes
.
func
,
onClick
:
PropTypes
.
func
,
onKeyDown
:
PropTypes
.
func
,
onKeyDown
:
PropTypes
.
func
,
...
@@ -42,6 +45,7 @@ Button.propTypes = {
...
@@ -42,6 +45,7 @@ Button.propTypes = {
Button
.
defaultProps
=
{
Button
.
defaultProps
=
{
buttonType
:
undefined
,
buttonType
:
undefined
,
classNames
:
[],
classNames
:
[],
inputRef
:
()
=>
{},
onBlur
:
()
=>
{},
onBlur
:
()
=>
{},
onClick
:
()
=>
{},
onClick
:
()
=>
{},
onKeyDown
:
()
=>
{},
onKeyDown
:
()
=>
{},
...
...
src/Dropdown.jsx
View file @
a7f8a8d2
...
@@ -47,6 +47,8 @@ class Dropdown extends React.Component {
...
@@ -47,6 +47,8 @@ class Dropdown extends React.Component {
componentDidUpdate
()
{
componentDidUpdate
()
{
if
(
this
.
state
.
open
)
{
if
(
this
.
state
.
open
)
{
this
.
menuItems
[
this
.
state
.
focusIndex
].
focus
();
this
.
menuItems
[
this
.
state
.
focusIndex
].
focus
();
}
else
if
(
this
.
toggleElem
)
{
this
.
toggleElem
.
focus
();
}
}
}
}
...
@@ -86,7 +88,6 @@ class Dropdown extends React.Component {
...
@@ -86,7 +88,6 @@ class Dropdown extends React.Component {
this
.
toggle
();
this
.
toggle
();
}
else
if
(
this
.
state
.
open
&&
Dropdown
.
isTriggerKey
(
'CLOSE_MENU'
,
e
.
key
))
{
}
else
if
(
this
.
state
.
open
&&
Dropdown
.
isTriggerKey
(
'CLOSE_MENU'
,
e
.
key
))
{
this
.
toggle
();
this
.
toggle
();
this
.
toggleElem
.
focus
();
}
}
}
}
...
@@ -138,7 +139,7 @@ class Dropdown extends React.Component {
...
@@ -138,7 +139,7 @@ class Dropdown extends React.Component {
dd
[
'dropdown-toggle'
],
dd
[
'dropdown-toggle'
],
]
}
]
}
type=
"button"
type=
"button"
r
ef=
{
(
toggleElem
)
=>
{
this
.
toggleElem
=
toggleElem
;
}
}
inputR
ef=
{
(
toggleElem
)
=>
{
this
.
toggleElem
=
toggleElem
;
}
}
/>
/>
<
ul
<
ul
aria
-
label=
{
this
.
props
.
title
}
aria
-
label=
{
this
.
props
.
title
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment