hiyaryan / the-cdj

The Cognitive Distortion Journal (CDJ) is a smart journaling tool that helps remedy distorted thinking. It can feel impossible to follow the CBT technique of labeling distorted thinking and finding alternative modes of thought (i.e. reframing) while cognitive distortions are occurring. The CDJ does that work for you. -- The CDJ is in beta testing!!
https://thecdj.app
2 stars 0 forks source link

Fix TypeError and scroll behavior. #112

Closed hiyaryan closed 5 months ago

hiyaryan commented 5 months ago

This PR closes #111. It does this by scrolling to the last message in the chat box only if there is a message to reference and only if the existing last message is not in view.

hiyaryan commented 5 months ago

Adds a new isElementInView function to the Chat component to check if the last message is in view. If not, and only if there is a reference to a last message (messages exist for the entry) does the alignment scrolling occur for the messages. Previously, it always occurred and the alignment appeared to bounce before the Chat component aligned itself.