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

Minor Proposed Change to Searchbox #2006

Open
@Celadora

Description

@Celadora

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions