Skip to content

Commit 2520376

Browse files
committed
Prevent selectors from exceeding CalendarStrip's height.
Left/right selector responsive sizing limits to container height. Fix WeekSelector shouldComponentUpdate criteria for size prop updates.
1 parent 2e5cb11 commit 2520376

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-calendar-strip",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "Easy to use and visually stunning calendar component for React Native",
55
"main": "index.js",
66
"directories": {

src/CalendarStrip.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ export default class CalendarStrip extends Component {
482482
let selectorSize = Math.round(dayComponentWidth / 2.5);
483483
let height = this.props.showMonth ? monthFontSize : 0;
484484
height += this.props.showDate ? dayComponentWidth : 0; // assume square element sizes
485+
selectorSize = Math.min(selectorSize, height);
485486

486487
this.setState({
487488
dayComponentWidth,

src/WeekSelector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class WeekSelector extends Component {
3737
delete _nextProps.iconComponent;
3838
delete _props.iconComponent;
3939

40-
return JSON.stringify(_props) !== JSON.stringify(_nextProps) &&
40+
return JSON.stringify(_props) !== JSON.stringify(_nextProps) ||
4141
this.props.iconComponent !== nextProps.iconComponent;
4242
}
4343

0 commit comments

Comments
 (0)