material icon indicating copy to clipboard operation
material copied to clipboard

Clear Button On AutoComplete

Open SriramaDanturthi opened this issue 11 years ago • 6 comments

Hi There is No Clear Button if we are using Float Label in Auto Complete. it should be there in float label or normal case

I found the button snippet in missing in autocomplete template in case of float label. please add clear button

it should be like this

function getInputElement() { if (attr.mdFloatingLabel) { return '


<input float type="search"
id="{{ inputId || 'fl-input-' + $mdAutocompleteCtrl.id }}"
name="{{inputName}}"
style="padding-right:26px;"
autocomplete="off"
ng-required="$mdAutocompleteCtrl.isRequired"
ng-minlength="inputMinlength"
ng-maxlength="inputMaxlength"
ng-disabled="$mdAutocompleteCtrl.isDisabled"
ng-model="$mdAutocompleteCtrl.scope.searchText"
ng-keydown="$mdAutocompleteCtrl.keydown($event)"
ng-blur="$mdAutocompleteCtrl.blur()"
ng-focus="$mdAutocompleteCtrl.focus()"
aria-owns="ul-{{$mdAutocompleteCtrl.id}}"
aria-label="{{floatingLabel}}"
aria-autocomplete="list"
aria-haspopup="true"
aria-activedescendant=""
aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"/>
<button
type="button"
tabindex="-1"
ng-if="$mdAutocompleteCtrl.scope.searchText && !$mdAutocompleteCtrl.isDisabled"
ng-click="$mdAutocompleteCtrl.clear()">

Clear

' + leftover + '

'; } else { return '
<input flex type="search"
id="{{ inputId || 'input-' + $mdAutocompleteCtrl.id }}"
name="{{inputName}}"
ng-if="!floatingLabel"
autocomplete="off"
ng-required="$mdAutocompleteCtrl.isRequired"
ng-disabled="$mdAutocompleteCtrl.isDisabled"
ng-model="$mdAutocompleteCtrl.scope.searchText"
ng-keydown="$mdAutocompleteCtrl.keydown($event)"
ng-blur="$mdAutocompleteCtrl.blur()"
ng-focus="$mdAutocompleteCtrl.focus()"
placeholder="{{placeholder}}"
aria-owns="ul-{{$mdAutocompleteCtrl.id}}"
aria-label="{{placeholder}}"
aria-autocomplete="list"
aria-haspopup="true"
aria-activedescendant=""
aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"/>
<button
type="button"
tabindex="-1"
ng-if="$mdAutocompleteCtrl.scope.searchText && !$mdAutocompleteCtrl.isDisabled"
ng-click="$mdAutocompleteCtrl.clear()">

Clear

'; } } } };

SriramaDanturthi avatar Jul 29 '15 09:07 SriramaDanturthi

Please put your code in a Plunker or Codepen to demonstrate the issue.

marcysutton avatar Jul 29 '15 16:07 marcysutton

Its Simple

Floating Label Doesn't Have Clear Button and Custom Template and Basic Usage has Clear Button.

https://material.angularjs.org/HEAD/#/demo/material.components.autocomplete

image

SriramaDanturthi avatar Jul 30 '15 16:07 SriramaDanturthi

+1 Seems like the autocomplete should have the clear button feature, regardless of the presentation

ghost avatar Aug 29 '15 10:08 ghost

+1 Fully agree with bluebirdtech. Clear must be present like in select.

Thanks

91K00 avatar Jan 07 '16 14:01 91K00

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a temporary error. The following address(es) deferred:

[email protected] Domain zyapps.com has exceeded the max emails per hour (416/400 (104%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------ Received: from o5.sgmail.github.com ([192.254.113.10]:10642) by serveur.ex2-p10.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from [email protected]) id 1avsZf-001Z5X-NR for [email protected]; Thu, 28 Apr 2016 22:30:12 +0200 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=github.com; h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe; s=s20150108; bh=31qFBVzoSRSaxAbj01WAK9Pc4po=; b=mMxV1jeWHUGqJ224 E2Nu2rWrv6mcJbVFWJUBZAoiZwgeIoRY8VwCFBIQIacstBm/dc405+yx5snnh1YQ iWU5SynqVr2Qv/bYJkFoWHNRaW4GmHU+FpHA4B+w6/DX1aBMG+VS1RJgf5b7Hi7g ZbkJddaVNfWhWf2B81YreSk55+o= Received: by filter0463p1mdw1.sendgrid.net with SMTP id filter0463p1mdw1.21062.572272A631 2016-04-28 20:29:26.511995772 +0000 UTC Received: from github-smtp2a-ext-cp1-prd.iad.github.net (github-smtp2a-ext-cp1-prd.iad.github.net [192.30.253.16]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id oV4vC4EjRKyLTNP2w46fYQ for [email protected]; Thu, 28 Apr 2016 20:29:26.537 +0000 (UTC) Date: Thu, 28 Apr 2016 13:29:26 -0700 From: Thomas Burleson [email protected] Reply-To: angular/material [email protected] To: angular/material [email protected] Cc: Message-ID: angular/material/issue/3939/issue_event/[email protected] In-Reply-To: angular/material/issues/[email protected] References: angular/material/issues/[email protected] Subject: Re: [angular/material] Clear Button On AutoComplete (#3939) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_572272a6499b3_49ff3fe6a175b29c5403bf"; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: list X-GitHub-Sender: ThomasBurleson X-GitHub-Recipient: yanndupuy List-ID: angular/material <material.angular.github.com> List-Archive: https://github.com/angular/material List-Post: mailto:[email protected] List-Unsubscribe: mailto:unsub+000df0dc327fcb3d3e7e7962ffc28f6861bbb7e76be0a89a92cf00000001133a34a692a169ce05d5c9eb@reply.github.com, https://github.com/notifications/unsubscribe/AA3w3LSmcgwMzjZqbtnZFUzXmS2Reci6ks5p8RimgaJpZM4Fh13E X-Auto-Response-Suppress: All X-GitHub-Recipient-Address: [email protected] X-SG-EID: /bDRkhSo/GH2gzZXMo5AKhbuTgLDPkexBjh/BYa140GSIog81J/IcE09YORL//f4BB7RkAkxjhDPwu HpRkmseTm3iVp4c/UqHuijNeBl6400Crjuk0vWDsMLS893yoypIdom7/gJZmdSjqG1P5WC1QkAi6dm S3zwdxkJ+HRP3Whw47PXuZ6We7sI21ke/CxV2CAUq7gnmxaILzL8RcyUxWGkeAOAHLGKZkpcD0GNXd g= X-Spam-Status: No, score=0.5 X-Spam-Score: 5 X-Spam-Bar: / X-Ham-Report: Spam detection software, running on the system "serveur.ex2-p10.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see root@localhost for details.

Content preview: Closed #3939. --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/angular/material/issues/3939#event-644848342 Closed #3939. [...]

Content analysis details: (0.5 points, 5.0 required)

pts rule name description


-1.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 1.6 HTML_IMAGE_ONLY_12 BODY: HTML: images with 800-1200 bytes of words 0.0 HTML_MESSAGE BODY: HTML included in message 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-Spam-Flag: NO

----==_mimepart_572272a6499b3_49ff3fe6a175b29c5403bf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit

Closed #3939.


You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/angular/material/issues/3939#event-644848342 ----==_mimepart_572272a6499b3_49ff3fe6a175b29c5403bf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Closed #3939.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

----==_mimepart_572272a6499b3_49ff3fe6a175b29c5403bf--

yanndupuy avatar Apr 28 '16 20:04 yanndupuy

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its recipients. This is a temporary error. The following address(es) deferred:

[email protected] Domain biomassiv.es has exceeded the max emails per hour (500/500 (100%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------ Received: from o4.sgmail.github.com ([192.254.112.99]:4460) by ps5.websitehostserver.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_1) (envelope-from [email protected]) id 1avsaa-000IgB-7B for [email protected]; Thu, 28 Apr 2016 15:31:08 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=github.com; h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe; s=s20150108; bh=e3kRv+HgVVEBVdkFYucd2eRQ/zw=; b=Xjrn6s2ZCzFDo7OP rdefGylDLiIA/qbIJMuImvA9VwHizluY2Ty4tSOHBamy9du+jyLXWLaCzcxmlDs9 IdzEqueHfmHvEsE3LhWrkDVQ4L5z29Kp73eQg6Qn7hUVoXI8AxecEh6EGHEa+PbJ Gp2w+WH/rU+007iR/lxeN5HN8UI= Received: by filter0837p1mdw1.sendgrid.net with SMTP id filter0837p1mdw1.16833.572272C79 2016-04-28 20:29:59.090581869 +0000 UTC Received: from github-smtp2a-ext-cp1-prd.iad.github.net (github-smtp2a-ext-cp1-prd.iad.github.net [192.30.253.16]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id btgUNUXHRp2B3zLELDW6cA for [email protected]; Thu, 28 Apr 2016 20:29:59.157 +0000 (UTC) Date: Thu, 28 Apr 2016 13:29:58 -0700 From: Thomas Burleson [email protected] Reply-To: angular/material [email protected] To: angular/material [email protected] Cc: Message-ID: angular/material/issue/3939/issue_event/[email protected] In-Reply-To: angular/material/issues/[email protected] References: angular/material/issues/[email protected] Subject: Re: [angular/material] Clear Button On AutoComplete (#3939) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_572272c6db882_49ff3fe6a175b29c55507c"; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: list X-GitHub-Sender: ThomasBurleson X-GitHub-Recipient: biomassives List-ID: angular/material <material.angular.github.com> List-Archive: https://github.com/angular/material List-Post: mailto:[email protected] List-Unsubscribe: mailto:unsub+0042d4e2b442c664b51961d9efa96a0c79872cafede81fc392cf00000001133a34c692a169ce05d5c9eb@reply.github.com, https://github.com/notifications/unsubscribe/AELU4uZQB6_Onsm5OlE6j7j24gRV0x3Vks5p8RjGgaJpZM4Fh13E X-Auto-Response-Suppress: All X-GitHub-Recipient-Address: [email protected] X-SG-EID: ZlaDthyue/4HG+EgTb7JoZYs48JNb2iQtCcPV6oIs9V4PSFrcv4dP9xb4R6c0OvDGIZRQ9BUHdDXVO UsrD/3IYMeuodGWifwLSz518fGcbBZJ0FLQpEUD2USH84wwdIqo8ojwRiOC8TlNRn9JEdkt6EDshz6 Su98oB/oyMQBkXpnJPSIpR0NvKW9B/ZutvPYjuGf0as3uf9Zx5LOjq+xg+EyoHP8XUHubYkDr9GXyn g=

----==_mimepart_572272c6db882_49ff3fe6a175b29c55507c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit

Closed #3939.


You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/angular/material/issues/3939#event-644848342 ----==_mimepart_572272c6db882_49ff3fe6a175b29c55507c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Closed #3939.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

----==_mimepart_572272c6db882_49ff3fe6a175b29c55507c--

biomassives avatar Apr 28 '16 20:04 biomassives