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
ab97d856
Commit
ab97d856
authored
Jun 12, 2017
by
Ari Rizzitano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix up classes
parent
30dafa9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
src/Dropdown.jsx
+9
-7
src/InputSelect/InputSelect.stories.jsx
+1
-1
No files found.
src/Dropdown.jsx
View file @
ab97d856
...
@@ -62,13 +62,13 @@ class Dropdown extends React.Component {
...
@@ -62,13 +62,13 @@ class Dropdown extends React.Component {
handleMenuKeyDown
(
e
)
{
handleMenuKeyDown
(
e
)
{
e
.
preventDefault
();
e
.
preventDefault
();
if
(
this
.
isTriggerKey
(
'CLOSE_MENU'
,
e
.
key
))
{
if
(
Dropdown
.
isTriggerKey
(
'CLOSE_MENU'
,
e
.
key
))
{
this
.
toggle
();
this
.
toggle
();
}
else
if
(
this
.
isTriggerKey
(
'NAVIGATE_DOWN'
,
e
.
key
))
{
}
else
if
(
Dropdown
.
isTriggerKey
(
'NAVIGATE_DOWN'
,
e
.
key
))
{
this
.
setState
({
this
.
setState
({
focusIndex
:
(
this
.
state
.
focusIndex
+
1
)
%
this
.
props
.
menuItems
.
length
,
focusIndex
:
(
this
.
state
.
focusIndex
+
1
)
%
this
.
props
.
menuItems
.
length
,
});
});
}
else
if
(
this
.
isTriggerKey
(
'NAVIGATE_UP'
,
e
.
key
))
{
}
else
if
(
Dropdown
.
isTriggerKey
(
'NAVIGATE_UP'
,
e
.
key
))
{
this
.
setState
({
this
.
setState
({
focusIndex
:
((
this
.
state
.
focusIndex
-
1
)
+
this
.
props
.
menuItems
.
length
)
%
focusIndex
:
((
this
.
state
.
focusIndex
-
1
)
+
this
.
props
.
menuItems
.
length
)
%
this
.
props
.
menuItems
.
length
,
this
.
props
.
menuItems
.
length
,
...
@@ -77,9 +77,9 @@ class Dropdown extends React.Component {
...
@@ -77,9 +77,9 @@ class Dropdown extends React.Component {
}
}
handleToggleKeyDown
(
e
)
{
handleToggleKeyDown
(
e
)
{
if
(
!
this
.
state
.
open
&&
this
.
isTriggerKey
(
'OPEN_MENU'
,
e
.
key
))
{
if
(
!
this
.
state
.
open
&&
Dropdown
.
isTriggerKey
(
'OPEN_MENU'
,
e
.
key
))
{
this
.
toggle
();
this
.
toggle
();
}
else
if
(
this
.
state
.
open
&&
this
.
isTriggerKey
(
'CLOSE_MENU'
,
e
.
key
))
{
}
else
if
(
this
.
state
.
open
&&
Dropdown
.
isTriggerKey
(
'CLOSE_MENU'
,
e
.
key
))
{
this
.
toggle
();
this
.
toggle
();
this
.
toggleElem
.
focus
();
this
.
toggleElem
.
focus
();
}
}
...
@@ -155,18 +155,20 @@ Dropdown.propTypes = {
...
@@ -155,18 +155,20 @@ Dropdown.propTypes = {
label
:
PropTypes
.
string
,
label
:
PropTypes
.
string
,
href
:
PropTypes
.
string
,
href
:
PropTypes
.
string
,
})).
isRequired
,
})).
isRequired
,
classes
:
PropTypes
.
shape
().
optional
,
classes
:
PropTypes
.
shape
,
};
};
Dropdown
.
defaultProps
=
{
Dropdown
.
defaultProps
=
{
classes
:
{
classes
:
{
dropdown
:
'dropdown'
,
dropdown
:
'dropdown'
,
active
:
'active'
,
active
:
'active'
,
toggle
:
'btn dropdown-toggle'
,
toggle
:
'btn
btn-secondary
dropdown-toggle'
,
screenreader
:
'sr-only'
,
screenreader
:
'sr-only'
,
show
:
'show'
,
show
:
'show'
,
menu
:
'dropdown-menu'
,
menu
:
'dropdown-menu'
,
menuActive
:
null
,
menuItem
:
'dropdown-item'
,
menuItem
:
'dropdown-item'
,
menuWrapper
:
null
,
},
},
};
};
...
...
src/InputSelect/InputSelect.stories.jsx
View file @
ab97d856
...
@@ -113,7 +113,7 @@ storiesOf('Dropdown', module)
...
@@ -113,7 +113,7 @@ storiesOf('Dropdown', module)
classes=
{
{
classes=
{
{
dropdown
:
'dropdown'
,
dropdown
:
'dropdown'
,
active
:
'active'
,
active
:
'active'
,
toggle
:
'btn dropdown-toggle'
,
toggle
:
'btn
btn-secondary border-0
dropdown-toggle'
,
screenreader
:
'sr-only'
,
screenreader
:
'sr-only'
,
show
:
'show'
,
show
:
'show'
,
menu
:
'dropdown-menu'
,
menu
:
'dropdown-menu'
,
...
...
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