mohebifar / mohebifar/react-native-copilot
Not able to see the options once after the scroll
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
useEffect(() => {
const handleStepChange = (step) => {
const currentOrder = step.order;
setTimeout(() => {
if (step?.wrapperRef?.current && scrollViewRef.current) {
step.wrapperRef.current.measure((x, y, width, height, pageX, pageY) => {
const previous = previousOrder.current;
if (previous !== null) {
let screenHeight = Dimensions.get('window').height;
if (currentOrder === 5) {
setTimeout(() => {
scrollViewRef.current.scrollTo({
y:360,
animated: true,
});
}, 500);
}
if (currentOrder === 8) {
scrollViewRef.current.scrollToEnd({
animated: true,
});
}
}
previousOrder.current = currentOrder;
});
} else {
console.warn('wrapperRef not available for step:', step.name);
}
}, 500); // small delay
};
copilotEvents.on('stepChange', handleStepChange);
return () => {
copilotEvents.off('stepChange', handleStepChange);
};
}, []);
have used the scrollref with a known height. But , just after the scroll, the tooltip with the message is going out of the screen where i am not able to even select the options
Also, the previous option might work, where the tooltip is pointing out to exactly the same view. But just after the scroll, the tooltip is somewhere where it is not even accessible.
i have tried all ways, i need some suggesstions to fix this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue around the useEffect handler for copilotEvents' stepChange event, focusing on scrollViewRef, wrapperRef, and the step orders that call scrollTo or scrollToEnd. Confirm that the tooltip remains aligned with the target view after scrolling and that the options remain accessible and selectable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100