-
Notifications
You must be signed in to change notification settings - Fork 29
Adding caretStyle to customize the caret #27
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
base: main
Are you sure you want to change the base?
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,6 +35,7 @@ export type PopableProps = { | |||||
| style?: PopoverProps['style']; | ||||||
| visible?: boolean; | ||||||
| wrapperStyle?: ViewProps['style']; | ||||||
| caretStyle?: ViewProps['style']; | ||||||
|
Owner
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.
Suggested change
|
||||||
| }; | ||||||
|
|
||||||
| const DEFAULT_LAYOUT = { | ||||||
|
|
@@ -61,6 +62,7 @@ const Popable = forwardRef<PopableManager, PopableProps>(function Popable( | |||||
| style, | ||||||
| visible, | ||||||
| wrapperStyle, | ||||||
| caretStyle, | ||||||
| }, | ||||||
| ref | ||||||
| ) { | ||||||
|
|
@@ -223,6 +225,7 @@ const Popable = forwardRef<PopableManager, PopableProps>(function Popable( | |||||
| <Popover | ||||||
| {...sharedPopoverProps} | ||||||
| forceInitialAnimation | ||||||
| caretStyle={caretStyle} | ||||||
|
Comment on lines
226
to
+228
Owner
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. Could const sharedPopoverProps = {
animated,
...,
caretPosition,
caretStyle, // <<If we don't, |
||||||
| visible={isPopoverVisible} | ||||||
| style={[ | ||||||
| { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,7 @@ export type PopoverProps = { | |||||
| forceInitialAnimation?: boolean; | ||||||
| numberOfLines?: number; | ||||||
| visible?: boolean; | ||||||
| caretStyle: ViewProps['style']; | ||||||
|
Owner
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.
Suggested change
|
||||||
| position?: 'top' | 'right' | 'bottom' | 'left'; | ||||||
| } & ViewProps; | ||||||
|
|
||||||
|
|
@@ -35,6 +36,7 @@ const Popover = React.forwardRef<View, PopoverProps>(function Popover( | |||||
| forceInitialAnimation = false, | ||||||
| numberOfLines, | ||||||
| visible = true, | ||||||
| caretStyle = null, | ||||||
|
Owner
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. No need to set a default value,
Suggested change
|
||||||
| position = 'bottom', | ||||||
| style, | ||||||
| ...extraProps | ||||||
|
|
@@ -84,7 +86,7 @@ const Popover = React.forwardRef<View, PopoverProps>(function Popover( | |||||
| align={caretPosition} | ||||||
| position={position} | ||||||
| backgroundColor={backgroundColor} | ||||||
| style={styles.caret} | ||||||
| style={[styles.caret, caretStyle]} | ||||||
| /> | ||||||
| ); | ||||||
|
|
||||||
|
|
||||||
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.
Could this be added alongside
caret*props?Below
caretPositionfor example!Please make sure to also change the position of the
caretStyleparagraph :)