Searchable multi-level dropdown in Semantic - semantic-ui

I'm trying to make a dropdown with submenus and a search box. So far the search string only applies to the first level menu and does not look into second level menu items. Is there a way to perform the search beyond the first level?
Minimal example here:
HTML:
<div class="ui segment">
<div class="ui search selection dropdown" id="test">
<span class="text">Search Selection</span>
<i class="dropdown icon"></i>
<div class="menu">
<div class="item">
<span class="text">Category 1</span>
</div>
<div class="item">
<i class="dropdown icon"></i>
<span class="text">Category 2</span>
<div class="menu">
<div class="item">Item 2A</div>
<div class="item">Item 2B</div>
<div class="item">Item 2C</div>
</div>
</div>
<div class="item">
<i class="dropdown icon"></i>
<span class="text">Category 3</span>
<div class="menu">
<div class="item">Item 3A</div>
<div class="item">Item 3B</div>
<div class="item">Item 3C</div>
</div>
</div>
</div>
</div>
</div>
JS:
$('#test')
.dropdown();
CSS:
.ui.selection.dropdown .menu {
overflow: visible !important;
}
JSFiddle link:
https://jsfiddle.net/o1aLysve/

Related

Card is overflowing outside its column bounds

I am using the following to show a list horizontally or vertically depending on the screen size.
<div class="row">
<div class="col-md-3">
<div class="d-md-none">
<div class="card">
<div class="card-body p-0">
<ul class="list-group list-group-horizontal">
<li class="list-group-item border-0">
<a href="javascript: void(0);" #onclick="">
<i class="fas fa-search" />
</a>
</li>
<li class="list-group-item border-0">
<a href="javascript: void(0);" #onclick="">
<i class="fas fa-address-card" />
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="d-none d-md-block">
<!-- Here the list vertically !-->
</div>
</div>
<div class="col-md-9">
</div>
</div>
The problem is that when viewed on mobile devices, the card overflows out of its div. What can I change to make this not happen? Can I decrease the spacing between the items?

Bootstrap dropdown inside accordion

I have an Accordion which has a header, inside which I need to place a dropdown menu. I've tried fiddling with the z-index thinking it was a stacking issue to no avail. I've reproduced the issue with a minimal sample at https://www.bootply.com/53bH05eQlf
Is there any way to get the dropdown menu to display correctly?
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="accordion">
<div class="card">
<div class="card-header">Blah</div>
</div>
<div class="card">
<div class="card-header">Blah</div>
</div>
<div class="card">
<div class="card-header">Blah
<div class="dropdown text-center show border-info border rounded menu-button float-left">
<a class="btn p-0 dropdown-toggle" href="#" role="button" id="some-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="fa fa-bars"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="some-dropdown">
<li class="dropdown-item">Hidden behind the card!</li>
</ul>
</div>
</div>
</div>
<div class="card">
<div class="card-header">Blah</div>
</div>
<div class="card">
<div class="card-header">Blah</div>
</div>
</div>
Adding style="overflow: visible" to the card div which contains the dropdown will solve the issue.
That is, for the bootply example replace <div class="card"> on line 8 with <div class="card" style="overflow: visible">.

Framework7 Side Panels not working

I'm developing an app mainly in HTML5/CSS/JS and I'm using framework7. Following the tutorials and all the documentation available I can't make a side panel appear... What am I doing wrong?
<body>
<div class="panel-overlay">
<div class="panel panel-left panel-reveal">
<div class="content-block">
<p>Menu de Opções</p>
<p>Fechar Menu</p>
</div>
</div>
</div>
<div class="views">
<div class="view view-main">
<div class="pages">
<div data-page="home" class="page navbar-fixed">
<div class="navbar">
<div class="navbar-inner">
<div class="left">
<a href="#" class="link icon-only open-panel" data-panel="left">
<i class="icon icon-bars"></i>
</a>
</div>
<div class="center">Home</div>
<div class="right"> <a href="#" class="link icon-only">
<i class="icon icon-back"></i></a>
</div>
</div>
</div>
<div class="page-content">
<div class="content-block">
<p>Menu</p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
I'm testing on Chrome, but nothing is happening... It is also not working on IE

Bootstrap scrollable tab panel content

I'm wondering if I can make the content in my tab panel scrollable. I have tried a couple things but I don't get it sorted.
<div class="container">
<div class="row">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Title</h3>
<span class="pull-right">
<ul class="nav panel-tabs">
<li class="active">Tab 1</li>
</ul>
</span>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane active" id="test">
CONTENT
</div>
</div>
</div>
</div>
</div>
Fiddle: http://jsfiddle.net/f3p35v76/
Are you looking for the content to scroll within the pane?
Fiddle: http://jsfiddle.net/uxsr66hp/1/
.tab-pane{
height:300px;
overflow-y:scroll;
width:100%;
}

How to achieve this layout with Bootstrap 3

I was wondering if someone knows how I cam accomplish this using Bootstrap 3 while not hacking it.
As you can see from the picture below I'd like to have an inverted navbar at the top. Underneath I'd like to have a bar with black bg that only goes so far (for instance 4 columns with dark bg and the remaining 8 columns with light bg). That's the easy part. The problem I've found is how have the container bg have different colour of background.
At the moment I have this:
That's been achieved using this code:
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container nt-container">
<div class="nt-header-top row">
<div class="col-md-4">
<h1 class="nt-logo">New Project</h1>
</div>
<div class="col-md-8 text-right">
<h3>Some slogan here</h3>
</div>
</div>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="row">
<div class="col-md-2">
<ul class="nav navbar-nav">
<li class="active"><span class="glyphicon glyphicon-home"></span></li>
<li><span class="glyphicon glyphicon-list"></span></li>
<li><span class="glyphicon glyphicon-envelope"></span></li>
</ul>
</div>
<div class="col-md-10 nt-top-title-bar">
<section class="row">
<div class="col-md-8 more-padding-left">
<h2 class="">Some slogan here</h2>
</div>
<div class="col-md-4 text-right">
<ul class="nav navbar-nav navbar-right">
<li class="active"><span class="glyphicon glyphicon-home"></span></li>
<li><span class="glyphicon glyphicon-list"></span></li>
<li><span class="glyphicon glyphicon-envelope"></span></li>
</ul>
</div>
</section>
</div>
</div>
</div>
<div class="container nt-container">
<div class="row">
<section class="col-md-2 nt-side-menu-section">
<ul class="list-group">
...
</ul>
</section>
<div class="col-md-5 more-padding-left">
<h2>Heading 1</h2>
<p>...</p>
</div>
<div class="col-md-5">
<h2>Heading</h2>
<p>...</p>
</div>
</div>
<hr>
<footer>
<p>© Company 2013</p>
</footer>
I though maybe I could add div on the right gutter with a light background on top of the container background, but I thought this very hackish and inelegant.
Any suggestions on how to achieve this?
Ok...if I have this right the element in question has a class of .nt-top-title-bar.
You can do this with a pseudo element by adding:
.nt-top-title-bar:after {
content: "";
position: absolute;
background: insert your color here; /* Match the background of menubar*/
top: 0;
bottom: 0;
width: 9999px; /* some huge width */
left: 100%;
}
Codepen Example
CSS-Tricks Reference

Resources