Skip to content
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

Increase z-index for menu content #603

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sepal_ui/frontend/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ main.v-content {padding-top: 0px !important;}
.leaflet-control-container .vuetify-styles .v-application {background: rgb(0,0,0,0);}
.v-alert__wrapper .progress {background-color: transparent;}
header.v-app-bar {z-index: 800 !important}
.v-menu__content {z-index: 801 !important}
nav.v-navigation-drawer {z-index: 900 !important}
30 changes: 17 additions & 13 deletions sepal_ui/sepalwidgets/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from natsort import humansorted
from traitlets import Any, Bool, Dict, Int, List, Unicode, link, observe

import sepal_ui.sepalwidgets as sw
from sepal_ui import color
from sepal_ui.frontend import styles as ss
from sepal_ui.message import ms
Expand All @@ -29,7 +30,7 @@
]


class DatePicker(v.Layout, SepalWidget):
class DatePicker(sw.Layout):
"""
Custom input widget to provide a reusable DatePicker. It allows to choose date as a string in the following format YYYY-MM-DD

Expand All @@ -50,11 +51,12 @@ class DatePicker(v.Layout, SepalWidget):

def __init__(self, label="Date", **kwargs):

kwargs["v_model"] = kwargs.get("v_model", "")

# create the widgets
date_picker = v.DatePicker(no_title=True, v_model=None, scrollable=True)
self.date_picker = v.DatePicker(no_title=True, scrollable=True, **kwargs)

self.date_text = v.TextField(
v_model=None,
label=label,
hint="YYYY-MM-DD format",
persistent_hint=True,
Expand All @@ -69,7 +71,7 @@ def __init__(self, label="Date", **kwargs):
offset_y=True,
v_model=False,
close_on_content_click=False,
children=[date_picker],
children=[self.date_picker],
v_slots=[
{
"name": "activator",
Expand All @@ -80,17 +82,19 @@ def __init__(self, label="Date", **kwargs):
)

# set the default parameter
kwargs["v_model"] = kwargs.pop("v_model", None)
kwargs["row"] = kwargs.pop("row", True)
kwargs["class_"] = kwargs.pop("class_", "pa-5")
kwargs["align_center"] = kwargs.pop("align_center", True)
kwargs["children"] = [v.Flex(xs10=True, children=[self.menu])]
layout_kwargs = {
"v_model": None,
"row": True,
"class_": "pa-5",
"align_center": True,
"children": [v.Flex(xs10=True, children=[self.menu])],
}

# call the constructor
super().__init__(**kwargs)
super().__init__(**layout_kwargs)

jslink((date_picker, "v_model"), (self.date_text, "v_model"))
jslink((self, "v_model"), (date_picker, "v_model"))
link((self.date_picker, "v_model"), (self.date_text, "v_model"))
link((self.date_picker, "v_model"), (self, "v_model"))

@observe("v_model")
def check_date(self, change):
Expand All @@ -102,7 +106,7 @@ def check_date(self, change):
self.date_text.error_messages = None

# exit immediately if nothing is set
if change["new"] is None:
if not change["new"]:
return

# change the error status
Expand Down