diff --git a/src/components/ui/popover/popover.component.tsx b/src/components/ui/popover/popover.component.tsx index ceffa77cc..ca6a155dd 100644 --- a/src/components/ui/popover/popover.component.tsx +++ b/src/components/ui/popover/popover.component.tsx @@ -33,8 +33,12 @@ import { PopoverPlacements, } from './type'; +interface PopoverModalChildrenProps extends React.ReactElement { + ref?: any +} + type PopoverModalProps = Overwrite; export interface PopoverProps extends PopoverViewProps, PopoverModalProps { diff --git a/src/components/ui/select/select.component.tsx b/src/components/ui/select/select.component.tsx index 708637a77..2fdc23b39 100644 --- a/src/components/ui/select/select.component.tsx +++ b/src/components/ui/select/select.component.tsx @@ -74,6 +74,7 @@ export type SelectElement = React.ReactElement; interface State { listVisible: boolean; + ref: any; } const CHEVRON_DEG_COLLAPSED: number = -180; @@ -222,10 +223,12 @@ export class Select extends React.Component { public state: State = { listVisible: false, + ref: React.createRef(), }; private service: SelectService = new SelectService(); private popoverRef = React.createRef(); + private listRef = React.createRef(); private expandAnimation: Animated.Value = new Animated.Value(0); private get isMultiSelect(): boolean { @@ -285,9 +288,25 @@ export class Select extends React.Component { }; private onPress = (): void => { + // console.log(this.state.ref); this.setOptionsListVisible(); + console.log(this.state.ref); + this.state.ref.current?.scrollToEnd(); }; + private asd = (ref: any): void => { + this.setState({ ref: { + current: ref + } }); + }; + + public componentDidUpdate() { + console.log(this.state.ref); + setTimeout(() => { + this.state.ref.current?.scrollToEnd(); + }, 1000); + } + private onPressIn = (event: GestureResponderEvent): void => { this.props.eva.dispatch([Interaction.ACTIVE]); this.props.onPressIn && this.props.onPressIn(event); @@ -500,6 +519,7 @@ export class Select extends React.Component { anchor={() => this.renderInputElement(touchableProps, evaStyle)} onBackdropPress={this.onBackdropPress}>