Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

Minor Proposed Change to Searchbox #2006

Open
Celadora opened this issue May 7, 2017 · 0 comments
Open

Minor Proposed Change to Searchbox #2006

Celadora opened this issue May 7, 2017 · 0 comments

Comments

@Celadora
Copy link

Celadora commented May 7, 2017

If a searchbox were to be prepended instead of appended, then adaptive placeholders could be used.

This requires a minor change:

SearchBoxParentModel.prototype.addToParentDiv = function() {
          var ref;
          this.parentDiv = angular.element(document.getElementById(this.scope.parentdiv));
          if ((ref = this.parentDiv) != null ? ref.length : void 0) {
            return this.parentDiv.append(this.input);
          }
        };

to

SearchBoxParentModel.prototype.addToParentDiv = function() {
          var ref;
          this.parentDiv = angular.element(document.getElementById(this.scope.parentdiv));
          if ((ref = this.parentDiv) != null ? ref.length : void 0) {
            return this.parentDiv.prepend(this.input);
          }
        };

an example of our use:

<div id="searchbox" style="position: relative;">
  <input class="adaptive-placeholder" style="width:100%" placeholder="" type="text" required>
  <label for="" placeholder="Search for Location" alt="Location"></label>

  <div id="searchbox.overlap" style="width:100%; top: 0; position: absolute;">
    <label for="" placeholder="Search for Location" alt="Location"></label>
  </div>
</div> 

This change would be nice because CSS doesn't allow selecting a previous sibling, and so labels should come after the input.

We hope this helps others that have a similar problem. Thank you.

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

No branches or pull requests

1 participant