Skip to content

Suggestion #4

@oranage-ninja-guy

Description

@oranage-ninja-guy

The wrapper div put around the input element can break layouts that depend on the input staying as inline. Suggest adding 'inline-block' to the style declaration on the wrapper div. This seems to work for my particular instance.

diff:

[sdavied@linuxweb js]$ svn diff jquery-clearsearch.js
Index: jquery-clearsearch.js
===================================================================
--- jquery-clearsearch.js       (revision 359)
+++ jquery-clearsearch.js       (working copy)
@@ -43,7 +43,7 @@
                                                divClass = settings.clearClass + '_div';

                                        if (!$this.parent().hasClass(divClass)) {
-                                               $this.wrap('<div style="position: relative;" class="'
+                                               $this.wrap('<div style="display: inline-block; position: relative;" class="'
                                                        + divClass + '">' + $this.html() + '</div>');
                                                $this.after('<a style="position: absolute; cursor: pointer;" class="'
                                                        + settings.clearClass + '">' + settings.linkText + '</a>');

Edit: posted the correct diff (old one applied to the anchor rather than div - oversight on my part)

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