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

Search dropdown not working #219

Open
jjhi11 opened this issue Jan 9, 2019 · 2 comments
Open

Search dropdown not working #219

jjhi11 opened this issue Jan 9, 2019 · 2 comments

Comments

@jjhi11
Copy link

jjhi11 commented Jan 9, 2019

I have multiple sources for my search widget and the dropdown is not opening with them. I first noticed this on .9 and seems to still not work with .10

@alaframboise
Copy link
Contributor

alaframboise commented Jan 10, 2019

I think the css is hiding it. Try something like this:

.calcite-maps .calcite-search-expander .esri-search__sources-button.esri-widget--button {
  display: flex !important;
}

.calcite-maps .calcite-search-expanded .esri-menu.esri-search__sources-menu {
  display: block !important;
}

@jg76379
Copy link

jg76379 commented May 14, 2019

That works but it leaves the drop-down arrow visible when the search is not expanded.

calcite-search

I didn't like how this looked so In order to hide drop-down until search widget is expanded I modified the setExpanded function in calcitemaps0arcgis-support.js like so:

  // calcitemaps-arcgis-support.js
  function setExpanded(e, expand) {
    var searchExpander = query(".calcite-search-expander .esri-search");
    var searchSourceMenu = query(".calcite-search-expander .esri-search__sources-menu");    // added
    if (searchExpander && searchExpander.length > 0) {
      if (expand) {
        query(searchExpander[0]).addClass("calcite-search-expanded");
        query(searchSourceMenu[0]).addClass("calcite-search-source-menu-expanded");  // added
        search._expanded = true;
      } else {
        query(searchExpander[0]).removeClass("calcite-search-expanded");
        query(searchSourceMenu[0]).removeClass("calcite-search-source-menu-expanded"); // added
        search._expanded = false;
      }
    }            
  }

I also put this in my CSS

 .calcite-search-expander .esri-search__sources-button{
  display: none;
}
.calcite-search-expanded .esri-search__sources-button{
  display: block;
}
.calcite-search-source-menu-expanded{
  display: block !important;
}

The results:

search-before

search-expanded

search-menu-expanded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants