kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Search Bar Backdrop in ActionBarSearchBox is not visible

Open jonboiser opened this issue 5 years ago • 16 comments

Observed behavior

There is code for a backdrop that should be shown when the search box is open on small screens. But it doesn't look like it is ever visible. Is this just cruft?

https://github.com/learningequality/kolibri/blob/a9d1f4b579804d587b90580a0a9eeaf1a7dee955/kolibri/plugins/learn/assets/src/views/ActionBarSearchBox.vue#L29

In Chrome devtools, it looks like it's a zero-height div in the ActionBar.

CleanShot 2021-04-14 at 13 39 18

Expected behavior

Backdrop is shown, or otherwise it's removed in the code.

jonboiser avatar Apr 14 '21 20:04 jonboiser

Hey @jonboiser, I have checked the issue. I think it is a zero-height div. What should be the approach to solve it?

Priyaraj17 avatar Apr 15 '21 12:04 Priyaraj17

@jonboiser @Priyaraj17 I think that adding height: 100vh to the following class would do the trick https://github.com/learningequality/kolibri/blob/a9d1f4b579804d587b90580a0a9eeaf1a7dee955/kolibri/plugins/learn/assets/src/views/ActionBarSearchBox.vue#L125-L133

kmrinal19 avatar Apr 21 '21 07:04 kmrinal19

@kmrinal19 This might work. But let's wait for the reaction and approval of the mentors @jonboiser.

Priyaraj17 avatar Apr 22 '21 10:04 Priyaraj17

@kmrinal19 That approach basically, works, but might need to move the top by a few pixels. I'm wondering if the right thing is to just remove this, since nobody even noticed it was missing.

@jtamiace Should we just remove this backdrop? Here is what it looks like. It doesn't seem to really add anything.

image

jonboiser avatar Apr 22 '21 21:04 jonboiser

May I work on this?

Priyaraj17 avatar Apr 27 '21 17:04 Priyaraj17

@Priyaraj17 I first want to get a confirmation whether or not we want to bring back the backdrop or delete it.

jonboiser avatar Apr 27 '21 18:04 jonboiser

@jonboiser okay sure. Thanks

Priyaraj17 avatar Apr 27 '21 18:04 Priyaraj17

Sorry for the late response - let's keep the backdrop in, since it focuses the user on entering keywords, and tapping the backdrop would allow them to dismiss the search input field without accidentally tapping on other interactive elements on the page

jtamiace avatar Apr 27 '21 20:04 jtamiace

@jonboiser @jtamiace I have worked on this issue and solved the issue. Shall I create a pull request?

Priyaraj17 avatar Apr 30 '21 20:04 Priyaraj17

Infact the 100 vh height is not cover the entire page, if someone scrolls down, the backdrop won't be visible. 150 vh is working fine.

Priyaraj17 avatar Apr 30 '21 21:04 Priyaraj17

@Priyaraj17 , giving a static height isn't a good solution here, since the height can vary in the future.

The issue is with its parent element(.scrolling-header), which has a transform property, that is restricting the viewport to its height.

Screenshot from 2021-05-01 23-35-12

ravvis avatar May 01 '21 18:05 ravvis

Okay..Let me see what can be done here. Thanks

Priyaraj17 avatar May 02 '21 08:05 Priyaraj17

@singh-ravi-siso Are you sure this is the problem? As things are working fine. I have tested for every small screen device

Priyaraj17 avatar May 03 '21 05:05 Priyaraj17

@jonboiser what do you think sir?

Priyaraj17 avatar May 04 '21 13:05 Priyaraj17

Infact the 100 vh height is not cover the entire page, if someone scrolls down, the backdrop won't be visible. 150 vh is working fine.

I don't understand how a user can scroll when the backdrop is visible. If the backdrop is visible, you should not be able to scroll the content behind it, nor should you be able to to scroll the backdrop itself. Similarly, you should not be able to cause the scrolling header to disappear. It might be possible that the backdrop is sized too tall, which could cause the page to overflow in the vertical direction. We want the backdrop to not do that, so you might need to use a more precise height, or use something like absolute or fixed positioning.

Basically, once the backdrop is activated, everything should be in a fixed layout and not be scrollable.

jonboiser avatar May 04 '21 18:05 jonboiser

Hey @jonboiser, I tried to use a different approach to solve this issue but I couldn't find one, and I used a precise height. I tested for different heights and I think this will solve this issue. But if there is something else that I can do to improve it, I will work on it. I hope it works. Thanks!

Priyaraj17 avatar May 10 '21 11:05 Priyaraj17