title: Dropdown partially visible in Kivy (Python)
body: <p>I am trying to create a generic menu bar in Kivy (GUI for Python) and I am having trouble with dropdown menus. They only partially appear and I don't know why (see under Submenu 1):</p>
  
  <p><img src="https://i.stack.imgur.com/JGOuO.png" alt="enter image description here"></p>
  
  <p>Here is my code if you want to check it :</p>
  
  <pre><code>#!/usr/bin/env python3
  
  from kivy.app import App
  #from kivy.uix.widget import Widget
  from kivy.uix.boxlayout import BoxLayout
  from kivy.uix.button import Button
  from kivy.uix.label import Label
  from kivy.uix.behaviors import ButtonBehavior
  from kivy.uix.dropdown import DropDown
  from kivy.properties import ListProperty, ObjectProperty
  #from kivy.uix.actionbar import ActionBar, ActionView, ActionGroup, ActionButton
  
  class MenuItem(ButtonBehavior, Label):
      '''Background color, in the format (r, g, b, a).'''
      background_color_normal = ListProperty([0.2, 0.2, 0.2, 1])
      background_color_down = ListProperty([0.3, 0.3, 0.3, 1])
      background_color = ListProperty()
      separator_color = ListProperty([0.8, 0.8, 0.8, 1])
      pass
  
  class MenuSubmenu(MenuItem):
      # The list of submenu items in dropdown menu
      submenu = ObjectProperty(None)
  
      def add_widget(self, submenu, **kwargs):
          if isinstance(submenu, MenuDropDown):
              self.submenu = submenu
          super().add_widget(submenu, **kwargs)
  
      def on_release(self, **kwargs):
          super().on_release(**kwargs)
          self.submenu.open(self)
  
  class MenuDropDown(DropDown):
      pass
  
  class MenuButton(MenuItem):
      pass
  
  class MenuBar(BoxLayout):
  
      '''Background color, in the format (r, g, b, a).'''
      background_color = ListProperty([0.2, 0.2, 0.2, 1])
      separator_color = ListProperty([0.8, 0.8, 0.8, 1])
  
      def __init__(self, **kwargs):
          self.itemsList = []
          super().__init__(**kwargs)
  
      def add_widget(self, item, index=0):
          if not isinstance(item, MenuItem):
              raise TypeError("MenuBar accepts only MenuItem widgets")
          super().add_widget(item, index)
          if index == 0:
              index = len(self.itemsList)
          self.itemsList.insert(index, item)
  
  class MenuApp(App):
  
      def button(self, nb):
          print("Button", nb, "triggered")
  
  if __name__ == '__main__':
      MenuApp().run()
  </code></pre>
  
  <p>And here the kv file :</p>
  
  <pre><code>#:kivy 1.0.9
  
  &lt;MenuItem&gt;:
      background_color: self.background_color_down if self.state=='down' else self.background_color_normal
      color: (1,1,1,1)
      canvas.before:
          Color:
              rgba: self.background_color
          Rectangle:
              pos: self.pos
              size: self.size
      canvas.after:
          Color:
              rgba: self.separator_color
          Line:
              rectangle: self.x,self.y,self.width,self.height
  
  &lt;MenuBar&gt;:
      size_hint_y: None
      height: 40
      canvas.before:
          Color:
              rgba: self.background_color
          Rectangle:
              pos: self.pos
              size: self.size
      canvas.after:
          Color:
              rgba: self.separator_color
          Line:
              points: self.x, self.y, self.x + self.width, self.y
  
  BoxLayout:
      orientation: "vertical"
  
      MenuBar:
          MenuSubmenu:
              text: "Submenu 1"
              MenuDropDown:
                  Button:
                      text: "Button 11"
                      on_release: app.button(11)
                  Button:
                      text: "Button 12"
                      on_release: app.button(12)
                  Button:
                      text: "Button 13"
                      on_release: app.button(13)
          MenuButton:
              text: "Button 2"
              on_release: app.button(2)
          MenuButton:
              text: "Button 3"
              on_release: app.button(3)
  
      Button:
          text: "Nothing"
          background_color: 0.4, 0.4, 0.4, 1
          background_normal: ""
  </code></pre>
  
  <p>It would be great if you know what happen or if you could redirect me to some place more appropriate to find an answer.</p>