angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

Minor Proposed Change to Searchbox

Open Celadora opened this issue 7 years ago • 0 comments

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.

Celadora avatar May 07 '17 03:05 Celadora