Add capability to style the currently selected time unit#71
Open
QuenK30 wants to merge 2 commits intotroberts-28:developfrom
Open
Add capability to style the currently selected time unit#71QuenK30 wants to merge 2 commits intotroberts-28:developfrom
QuenK30 wants to merge 2 commits intotroberts-28:developfrom
Conversation
Owner
|
Hey @QuenK30, thank you for putting this PR together! Will review ASAP and get back to you 🙌 |
troberts-28
reviewed
Feb 1, 2026
Owner
troberts-28
left a comment
There was a problem hiding this comment.
Hey @QuenK30 👋 This looks great - thank you! The only thing missing is a corresponding update to the README. Will get this merged as soon as you've added that
| allowFontScaling={allowFontScaling} | ||
| style={[ | ||
| styles.pickerItem, | ||
| isSelected ? styles.selectedPickerItem : {}, |
Owner
There was a problem hiding this comment.
Would marginally prefer isSelected && styles.selectedPickerItem here
Author
|
I hope I didn't go off topic with this little change |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the ability to customize the style of the currently selected item (hour, minute, second, or day) in the
TimerPicker. Previously, all items shared the same styling, making it difficult to visually distinguish the exact selected value beyond its central position.
Key Changes
Styling System: Added a new selectedPickerItem property to
CustomTimerPickerStyles in styles.ts
Logic Flow: Updated TimerPicker.tsx to track and pass the current selected state down to the individual scroll components.
Component Update: Modified DurationScroll.tsx and PickerItem.tsx to receive the selectedValue and apply the selectedPickerItem style conditionally when an item is selected.
How to use
Users can now pass a selectedPickerItem object within the styles prop to highlight the active selection:
Verification
Automated tests: All 275 tests passed successfully (npm test).
Manual verification: Confirmed that the style is correctly applied to the center item and updates during scrolling.
This is my first PR for an open-source project, so thank you for your patience; I’m happy to make any changes or improvements based on your feedback!