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

Addition of wheel event and scroll buttons #71

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cb1ad1a
Fix empty ref scroll
Jul 17, 2019
ac8fb11
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
20e14b1
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
be4f1d2
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
0b62ffa
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
d2f6c00
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
4c10fbc
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
0f42ea6
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
6667c7f
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
834ce2d
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
8682e7b
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
6a80ab9
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
da7cc45
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
7ff0ef8
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
6998fa0
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
6bfd0fa
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 5, 2023
65d001c
[feature] Support for wheel event (mvieracanive)
maiavierasedicii Jan 6, 2023
7b317c5
[feature] Support for click event (mvieracanive)
maiavierasedicii Jan 6, 2023
abf2aaf
[feature] Support for click event (mvieracanive)
maiavierasedicii Jan 6, 2023
30ffa2d
[feature] Support for click event (mvieracanive)
maiavierasedicii Jan 6, 2023
23c4a3c
[feature] Support for click event (mvieracanive)
maiavierasedicii Jan 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[feature] Support for wheel event (mvieracanive)
  • Loading branch information
maiavierasedicii committed Jan 6, 2023
commit 6667c7fc6ebfc48414c3d06ef4622f8360087b15
4 changes: 3 additions & 1 deletion lib/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Props = {
onChange: Function,
onSelect: Function,
onCancel: Function,
themeColor?: String,
}

type State = {
Expand Down Expand Up @@ -198,7 +199,8 @@ class DatePicker extends Component<void, Props, State> {
step={item.step}
type={item.type}
format={item.format}
onSelect={this.handleDateSelect} />
onSelect={this.handleDateSelect}
themeColor={ this.props.themeColor } />
))}
</div>
{showFooter && <div className="datepicker-navbar">
Expand Down
9 changes: 8 additions & 1 deletion lib/DatePickerItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Props = {
format: string | Array<*>,
step: number,
onSelect: Function,
themeColor?: String,
}

type State = {
Expand Down Expand Up @@ -360,12 +361,18 @@ class DatePickerItem extends Component<void, Props, State> {
marginTop: this.state.marginTop,
});

const style = {}
if (this.props.themeColor) {
style.borderTopColor = this.props.themeColor
style.borderBottomColor = this.props.themeColor
}

return (
<div className="datepicker-col-1">
<div
ref={viewport => this.viewport = viewport} // eslint-disable-line
className="datepicker-viewport">
<div className="datepicker-wheel">
<div className="datepicker-wheel" style = { style }>
<ul
ref="scroll"
className="datepicker-scroll"
Expand Down
4 changes: 2 additions & 2 deletions lib/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
}

.datepicker {
position: absolute;
position: relative;
left: 0;
bottom: 0;
width: 100%;
width: 300px;
z-index: 1;
font-size: 16px;
text-align: center;
Expand Down