Repository: ppizarror/pygame-menu

Issue:
dropselect not working properly with touchscreen 
**Environment information**
Describe your environment information, such as:
- SO: linux
- python version: v3.7/3.8
- pygame version: v2.0.1
- pygame-menu version: v4.0.6

**Describe the bug**
with a touchscreen (having `touchscreen=True` and `mouse_enabled=False` in the initialization)
a) I can't scroll the option of a `dropselect`.
b) there is an exception when I touch the `dropselect` (either in the label or the drop area) when the dropselect has one or two item. With three or more items it doesn't raise the exception.
When there are one or two items, it fails to enter the condition in this line
https://github.com/ppizarror/pygame-menu/blob/3d8ef71b882a6e7bcbe7299af8d16fbcc0875d8f/pygame_menu/widgets/widget/dropselect.py#L1159
I think because of the self.active
Doesn't happen if I'm working with the mouse, because with the mouse `.is_scrolling()` is never called.

```
Traceback (most recent call last):
  File "test.py", line 41, in <module>
    main()
  File "test.py", line 36, in main
    menu.mainloop(surface)
  File "/home/pi/touchenv/lib/python3.7/site-packages/pygame_menu/menu.py", line 2788, in mainloop
    self.update(pygame.event.get())
  File "/home/pi/touchenv/lib/python3.7/site-packages/pygame_menu/menu.py", line 2387, in update
    elif selected_widget is not None and selected_widget.update(events):
  File "/home/pi/touchenv/lib/python3.7/site-packages/pygame_menu/widgets/widget/dropselect.py", line 1179, in update
    self._drop_frame.get_scrollarea(inner=True).is_scrolling()):
AttributeError: 'NoneType' object has no attribute 'is_scrolling'
```

**To Reproduce**
```
import pygame, pygame_menu

SCREENWIDTH  = 800
SCREENHEIGHT = 480

def main():
    pygame.init()

    surface = pygame.display.set_mode((SCREENWIDTH, SCREENHEIGHT), pygame.FULLSCREEN)

    def test_1(select):
        sVal = select.get_value()
        items = select._items
        items.pop(items.index(sVal[0]))
        select._index = -1
        select.update_items(items)
        select.make_selection_drop()
        print('removed {} left'.format(len(items)))


    menu = pygame_menu.Menu('Test', SCREENWIDTH, SCREENHEIGHT,
                            theme = pygame_menu.themes.THEME_DARK,
                            onclose = pygame_menu.events.RESET,
                            touchscreen = True,
                            joystick_enabled = False,
                            mouse_enabled = False,
                            )

    S1 = menu.add.dropselect('Subject Id', items=[('a',),('b',),('c',),('d',),('e',),('f',)], dropselect_id='s0')
    #S1 = menu.add.dropselect('Subject Id', items=[('a',)], dropselect_id='s0')
    #S1 = menu.add.dropselect('Subject Id', items=[('a',),('b',)], dropselect_id='s0')
    #S1 = menu.add.dropselect('Subject Id', items=[('a',),('b',),('c',)], dropselect_id='s0')
    menu.add.button('One',test_1, S1)

    # Allows menu to be run
    menu.mainloop(surface)
    print(menu.get_input_data())
    return

if __name__ == "__main__":
    main()
```

Discussion:

Patch:
diff --git a/pygame_menu/widgets/widget/dropselect.py b/pygame_menu/widgets/widget/dropselect.py
index 0d5805f2..351397cd 100644
--- a/pygame_menu/widgets/widget/dropselect.py
+++ b/pygame_menu/widgets/widget/dropselect.py
@@ -1109,6 +1109,16 @@ class DropSelect(Widget):
             rect.width -= self._selection_box_border_width
         return rect
 
+    def _drop_frame_scrolling(self) -> bool:
+        """
+        Checks if drop frame is scrolling.
+
+        :return: ``True`` if scrolling
+        """
+        if self._drop_frame is None or self._drop_frame.get_scrollarea(inner=True) is None:
+            return False
+        return self._drop_frame.get_scrollarea(inner=True).is_scrolling()
+
     def update(self, events: EventVectorType) -> bool:
         self.apply_update_callbacks(events)
 
@@ -1181,11 +1191,9 @@ class DropSelect(Widget):
             # Click on dropselect; don't consider the mouse wheel (button 4 & 5)
             elif self.active and (
                     event.type == pygame.MOUSEBUTTONDOWN and self._mouse_enabled and
-                    event.button in (1, 2, 3) or (
-                            event.type == FINGERDOWN and self._touchscreen_enabled and
-                            self._drop_frame is not None and
-                            not self._drop_frame.get_scrollarea(inner=True).is_scrolling() and
-                            self._menu is not None)
+                    event.button in (1, 2, 3) or
+                    event.type == FINGERDOWN and self._touchscreen_enabled and
+                    self._menu is not None and not self._drop_frame_scrolling()
             ):
                 event_pos = get_finger_pos(self._menu, event)
                 if self._drop_frame.get_rect(apply_padding=False, to_real_position=True
@@ -1196,10 +1204,7 @@ class DropSelect(Widget):
             elif event.type == pygame.MOUSEBUTTONUP and self._mouse_enabled and \
                     event.button in (1, 2, 3) or \
                     event.type == FINGERUP and self._touchscreen_enabled and \
-                    self._menu is not None and \
-                    not (self._drop_frame is not None and
-                         self._drop_frame.get_scrollarea(inner=True) is not None and
-                         self._drop_frame.get_scrollarea(inner=True).is_scrolling()):
+                    self._menu is not None and not self._drop_frame_scrolling():
 
                 # Check for mouse clicks within
                 if self.active:


Test patch:
diff --git a/test/_utils.py b/test/_utils.py
index 6948e9e2..2e60e188 100644
--- a/test/_utils.py
+++ b/test/_utils.py
@@ -447,6 +447,7 @@ class PygameEventUtils(object):
             y: NumberType,
             inlist: bool = True,
             evtype: int = FINGERUP,
+            rel: Tuple2IntType = (0, 0),
             normalize: bool = True,
             menu: Union['pygame_menu.Menu', None] = None,
             testmode: bool = True
@@ -458,6 +459,7 @@ class PygameEventUtils(object):
         :param y: Y coordinate
         :param inlist: Return event in a list
         :param evtype: Event type, it can be FINGERUP, FINGERDOWN or FINGERMOTION
+        :param rel: Rel position (relative movement)
         :param normalize: Normalize event position
         :param menu: Menu reference
         :param testmode: Event is in test mode
@@ -465,6 +467,7 @@ class PygameEventUtils(object):
         """
         assert isinstance(x, NumberInstance)
         assert isinstance(y, NumberInstance)
+        assert_vector(rel, 2, int)
         if normalize:
             assert menu is not None, \
                 'menu reference must be provided if normalize is used (related to touch events)'
@@ -473,9 +476,10 @@ class PygameEventUtils(object):
             y /= display_size[1]
         event_obj = pygame.event.Event(evtype,
                                        {
-                                           'test': testmode,
                                            'x': x,
-                                           'y': y
+                                           'y': y,
+                                           'rel': rel,
+                                           'test': testmode
                                        })
         if inlist:
             event_obj = [event_obj]
diff --git a/test/test_widgets.py b/test/test_widgets.py
index fe6d3ee2..ce90cc1f 100644
--- a/test/test_widgets.py
+++ b/test/test_widgets.py
@@ -2505,6 +2505,16 @@ class WidgetsTest(unittest.TestCase):
         sel.update(PygameEventUtils.touch_click(touch_sel[0], touch_sel[1] + 80, menu=menu))
         self.assertEqual(sel.get_index(), 0)
         self.assertFalse(sel.active)
+        sel.update(PygameEventUtils.touch_click(touch_sel[0], touch_sel[1], menu=menu))
+        self.assertTrue(sel.active)
+        sel.update(PygameEventUtils.touch_click(touch_sel[0], touch_sel[1] + 80, menu=menu,
+                                                evtype=pygame.FINGERDOWN))
+        sel.update(PygameEventUtils.touch_click(touch_sel[0], touch_sel[1], menu=menu))
+        self.assertFalse(sel.active)
+
+        # Ignore buttons if not active
+        self.assertFalse(sel.update(PygameEventUtils.key(pygame_menu.controls.KEY_MOVE_UP,
+                                                         keydown=True)))
 
     def test_none(self) -> None:
         """