-
Notifications
You must be signed in to change notification settings - Fork 175
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
removed scroll on adding new question #4181
Merged
vkWeb
merged 4 commits into
learningequality:unstable
from
Jaspreet-singh-1032:fixes-4079-add-new-question-should-show-question-type
Aug 1, 2023
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
contentcuration/contentcuration/frontend/channelEdit/components/edit/EditView.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hi @Jaspreet-singh-1032, thank you for the changes here. Although I have some queries, removing this if statement would completely eliminate the smooth animation effect. Instead, we may want to enable scrolling with animation to the "response type" field rather than the "title/question". @MisRob @LianaHarris360 can you guide on the exact behaviour here? Removing the if statement does seem to work altho there won't be any scroll animation.
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.
Yes, I think we would want to keep the animation scroll. As for enabling scrolling to the "response type" field, the
scrollIntoView()
method takes in ablock
argument in addition tobehavior
, that defines the vertical alignment and the default is set to 'start' which doesn't seem to scroll to the preferred view, so possibly trying 'center' or 'nearest' could be an option.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.
The maximum of the
response type
shown by usingblock: end or nearest
.This is how it looks.
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.
It seems to me that it's caused by the secondary bar (with "Details", "Questions", "Related"). Even though the scroll position is correct, the element we scrolled into view is hidden underneath the bar. I think that one way to deal with it might be something like:
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.
Thanks, I will try this solution. However, the
window.scrollTo
function was not working here, but I will research it. It could be due to some CSS.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.
Ah, yes, this is a modal actually, so I assume that's the reason. Perhaps
Element.scrollTo()
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo could be used then.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.
The
scrollTo
did not work on any of the elements. I think this is because there is an outer scrollable div in which all these elements are rendered and thescrollTo
only works on the outer parent div and not on the internal elements.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.
I was able to scroll using the outer div with
scrollTo
function. I think I can implement a workaround using it 💡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.
Ah, that sounds tricky. Wonderful you found a workaround, let's see. Let us know if you needed anything.