-
Notifications
You must be signed in to change notification settings - Fork 195
Custom scroll in year picker and allow editing button #202
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ export interface HeaderPickProps { | |
| editIcon?: string | ||
| calendarIcon?: string | ||
| closeIcon?: string | ||
| allowEditing?: boolean | ||
| } | ||
|
|
||
| export interface HeaderContentProps extends HeaderPickProps { | ||
|
|
@@ -62,19 +63,18 @@ export default function DatePickerModalContentHeader( | |
| editIcon, | ||
| calendarIcon, | ||
| inputDate, | ||
| allowEditing, | ||
| } = props | ||
| const theme = useTheme() | ||
| const label = getLabel(props.locale, props.mode, props.label) | ||
|
|
||
| const color = useHeaderTextColor() | ||
| const supportingTextColor = theme.isV3 ? theme.colors.onSurfaceVariant : color | ||
| let allowEditing = mode !== 'multiple' | ||
|
|
||
| if (inputDate !== undefined) { | ||
| allowEditing = inputDate | ||
| } | ||
| const isAllowEditing = allowEditing && mode !== 'multiple' && inputDate !== undefined | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this change brought some undesired side effects, as is not equivalent to making The first is overriding the value of At the same time, the existing All of this make the edit button to always be hidden regardless the value passed for the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @jcloquell, thanks for catching this! Would you mind creating a quick PR to address this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jcloquell i think can change to this: And remove this: What do you think?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! Here is the PR - #264 :) |
||
|
|
||
| const supportingTextColor = theme.isV3 ? theme.colors.onSurfaceVariant : color | ||
|
|
||
| let textFont = theme?.isV3 | ||
| const textFont = theme?.isV3 | ||
| ? theme.fonts.labelMedium | ||
| : (theme as any as MD2Theme).fonts.medium | ||
|
|
||
|
|
@@ -103,7 +103,7 @@ export default function DatePickerModalContentHeader( | |
| </View> | ||
| </View> | ||
| <View style={styles.fill} /> | ||
| {allowEditing ? ( | ||
| {isAllowEditing ? ( | ||
| <IconButton | ||
| icon={ | ||
| collapsed | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is always
true. Shouldn't it be{props.allowEditing ?? true}instead?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jcloquell Yup I agree.
it should be
allowEditing={props.allowEditing ?? true}