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
0a21f55f
Commit
0a21f55f
authored
Sep 18, 2017
by
Ari Rizzitano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch dropdown for bootstrap v4
parent
bdde7afe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
16 deletions
+30
-16
src/Dropdown/Dropdown.scss
+12
-0
src/Dropdown/index.jsx
+18
-16
No files found.
src/Dropdown/Dropdown.scss
View file @
0a21f55f
...
@@ -3,3 +3,15 @@
...
@@ -3,3 +3,15 @@
.btn-borderless
{
.btn-borderless
{
border
:
0
!
important
;
border
:
0
!
important
;
}
}
// Trying to patch this upstream, then this can
// be removed.
// https://github.com/twbs/bootstrap/pull/23990
.show
{
>
a
:focus
{
outline-width
:
2px
;
outline-style
:
solid
;
outline-color
:
Highlight
;
outline
:
-
webkit-focus-ring-color
auto
5px
;
}
}
src/Dropdown/index.jsx
View file @
0a21f55f
...
@@ -98,19 +98,18 @@ class Dropdown extends React.Component {
...
@@ -98,19 +98,18 @@ class Dropdown extends React.Component {
generateMenuItems
(
menuItems
)
{
generateMenuItems
(
menuItems
)
{
return
menuItems
.
map
((
menuItem
,
i
)
=>
(
return
menuItems
.
map
((
menuItem
,
i
)
=>
(
<
li
className=
{
styles
[
'dropdown-item'
]
}
key=
{
i
}
>
<
a
<
a
className=
{
styles
[
'dropdown-item'
]
}
role=
"menuitem"
href=
{
menuItem
.
href
}
href=
{
menuItem
.
href
}
key=
{
i
}
onKeyDown=
{
this
.
handleMenuKeyDown
}
onKeyDown=
{
this
.
handleMenuKeyDown
}
ref=
{
(
item
)
=>
{
ref=
{
(
item
)
=>
{
this
.
menuItems
[
i
]
=
item
;
this
.
menuItems
[
i
]
=
item
;
}
}
}
}
tabIndex=
"-1"
role=
"menuitem"
>
>
{
menuItem
.
label
}
{
menuItem
.
label
}
</
a
>
</
a
>
</
li
>
));
));
}
}
...
@@ -138,14 +137,17 @@ class Dropdown extends React.Component {
...
@@ -138,14 +137,17 @@ class Dropdown extends React.Component {
type=
"button"
type=
"button"
inputRef=
{
(
toggleElem
)
=>
{
this
.
toggleElem
=
toggleElem
;
}
}
inputRef=
{
(
toggleElem
)
=>
{
this
.
toggleElem
=
toggleElem
;
}
}
/>
/>
<
ul
<
div
aria
-
label=
{
this
.
props
.
title
}
aria
-
label=
{
this
.
props
.
title
}
aria
-
hidden=
{
!
this
.
state
.
open
}
aria
-
hidden=
{
!
this
.
state
.
open
}
className=
{
styles
[
'dropdown-menu'
]
}
className=
{
classNames
([
styles
[
'dropdown-menu'
],
{
[
styles
.
show
]:
this
.
state
.
open
},
])
}
role=
"menu"
role=
"menu"
>
>
{
menuItems
}
{
menuItems
}
</
ul
>
</
div
>
</
div
>
</
div
>
);
);
}
}
...
...
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