prabhuignoto / react-chrono

🕑 Modern Timeline Component for React
https://react-chrono.prabhumurthy.com
MIT License
3.95k stars 212 forks source link

The autoScroll property of the TimelineCard component #120

Open edc-hui opened 3 years ago

edc-hui commented 3 years ago

The autoScroll property of the TimelineCard component props needs to be turned on at the developer's discretion. My current requirement here is that Autoscroll cannot be used.

My English is not very good, I wonder if you can understand。

edc-hui commented 3 years ago

AutoScroll props, the component of TimelineCard, needs to be released for the developer to decide whether it is necessary to apply for it or not. Currently, I do not need to use this props from my side.

prabhuignoto commented 3 years ago

@edc-hui will be adding a new prop useReadMore. The prop can be used to switch off the read more functionality and the card will expand to fit the content. hope this would resolve the problem you are facing.

edc-hui commented 3 years ago

@prabhuignoto when the mode is horizontal and the card content is too high, the page will automatically scroll down. Now the goal is not to scroll. Because of multiple cards, some cards are high and some cards are low, switching back and forth will cause a bad interactive experience. what should i do please

edc-hui commented 3 years ago

@prabhuignoto file path : src/components/timeline-elements/timeline-card-content/timeline-card-content.tsx . this file has lines 160 and 167 that are commented out, so I can use a props to determine the execution of this line of code. Will you consider it? specific code: “containerRef.current && containerRef.current.focus()”

prabhuignoto commented 3 years ago

@prabhuignoto when the mode is horizontal and the card content is too high, the page will automatically scroll down. Now the goal is not to scroll. Because of multiple cards, some cards are high and some cards are low, switching back and forth will cause a bad interactive experience. what should i do please

have you tried using the cardHeight to set a fixed height. This along with the new useReadMore prop might mitigate this problem

prabhuignoto commented 3 years ago

@prabhuignoto file path : src/components/timeline-elements/timeline-card-content/timeline-card-content.tsx . this file has lines 160 and 167 that are commented out, so I can use a props to determine the execution of this line of code. Will you consider it? specific code: “containerRef.current && containerRef.current.focus()”

sorry i didn't understand your questions. can you elaborate the problem you are facing.

prabhuignoto commented 3 years ago

@edc-hui did the new updates 1.9.3 help you to solve the problem. let me know

edc-hui commented 3 years ago

@prabhuignoto sorry recently too busy to reply in time . after the test 1.9.3 , It didn't solve my problem. i can't using the cardHeight to set a fixed height, because the card height is not fixed in my project. When I remove this line of code that "containerRef.current && containerRef.current.focus()", it solved the problem I ran into. And the location of this line of code file path : src/components/timeline-elements/timeline-card-content/timeline-card-content.tsx .