material icon indicating copy to clipboard operation
material copied to clipboard

Input messages disappear

Open gisek opened this issue 10 years ago • 3 comments

I originally posted the question on angular.js repo (https://github.com/angular/angular.js/issues/13723), but was instructed to move it here.

Please take look at the Angular Material demo site at the Postal Code input: https://material.angularjs.org/1.0.1/demo/input

Scenario 1 (works ok)

  1. We start with a_1
  2. Mark whole text in the input and click backspace
  3. Result a_2
  4. Everything is ok

Scenatio 2 (bug)

  1. We start with 1
  2. Delete last digit and you and up with (still ok) 2
  3. Delete the rest of the input one by one: 3
  4. BUG, the should be 'You must supply a postal code' message, but there is nothing
  5. Type a digit: 4
  6. BUG again, there should be a message: 'That doesn't look like a valid postal code', but there is nothing
  7. Type the rest of the digits 5
  8. Now it's ok
  9. Delete the last digit 6
  10. It's ok again

The messages are present in DOM, but the message container size seems to be calculated in a wrong way.

This is how it looks when the message is visible image

This is how it looks when the message is invisible image

gisek avatar Jan 09 '16 22:01 gisek

I think I found the problem:

https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L639-L642 says If we have the md-auto-hide class, the md-input-invalid animation will fire, so we can skip. However, it does not.

The animation is supposed to be triggered by the setInvalid function https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L86

setInvalid is triggered by scope.$watch(isErrorGetter, containerCtrl.setInvalid);

It cannot differentiate between errors such as invalid zipcode or missing zipcode, therefore the new message is not displayed (isErrorGetter stays true). That also explains #6399 #6440 (and maybe #6443?)

A dirty fix is to remove https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L639-L642 but there might be other problems because of that.

grosem avatar Jan 15 '16 21:01 grosem

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 (497/400 (124%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------ Received: from github-smtp2-ext4.iad.github.net ([192.30.252.195]:38119 helo=github-smtp2a-ext-cp1-prd.iad.github.net) by serveur.ex2-p10.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86) (envelope-from [email protected]) id 1aKBag-001uyW-Kb for [email protected]; Fri, 15 Jan 2016 22:07:31 +0100 Date: Fri, 15 Jan 2016 13:06:40 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1452892000; bh=77Elth5lFWTrvyXDpTD06XJttyUPAMJ7ATOa66EzXxw=; h=From:Reply-To:To:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=kId50+08eSIyUZnWoQQjgmNCuB4xNpVV/eQVSClKKRshi6bxywr5OAEREjGgniuzo UkyVgds9GanjLJ0gt2HDXwfKGDPPmMxbAvyazE1ehkqs09+gcdgZE/As8qwcvdha4V 2GIbpotgPKHC4EtFOvaA5+T9TWKSqG/xf64yx3UE= From: grosem [email protected] Reply-To: angular/material [email protected] To: angular/material [email protected] Message-ID: angular/material/issues/6610/[email protected] In-Reply-To: angular/material/issues/[email protected] References: angular/material/issues/[email protected] Subject: Re: [material] Input messages disappear (#6610) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="--==_mimepart_56995f60aa8be_3f7a3fbf0dae72a080978e"; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: list X-GitHub-Sender: grosem 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+000df0dc703f7245dd8d44f04cc65cb72462aee67acd1d6192cf0000000112b1216092a169ce077f5170@reply.github.com, https://github.com/notifications/unsubscribe/AA3w3GzAW9NpK-gSCMNm3zUe2sRg5W07ks5paVbggaJpZM4HBxRj X-Auto-Response-Suppress: All X-GitHub-Recipient-Address: [email protected] X-Spam-Status: No, score=-4.9 X-Spam-Score: -48 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: I think I found the problem: https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L639-L642 says If we have the md-auto-hide class, the md-input-invalid animation will fire, so we can skip. However, it does not. [...]

Content analysis details: (-4.9 points, 5.0 required)

pts rule name description


-0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [192.30.252.195 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.30.252.195 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 HTML_IMAGE_ONLY_32 BODY: HTML: images with 2800-3200 bytes of words 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.2 KAM_LOTSOFHASH Emails with lots of hash-like gibberish X-Spam-Flag: NO

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

I think I found the problem:

https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L639-L642 says If we have the md-auto-hide class, the md-input-invalid animation will fire, so we can skip. However, it does not.

The animation is supposed to be triggered by the setInvalid function https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L86

setInvalid is triggered by scope.$watch(isErrorGetter, containerCtrl.setInvalid);

It cannot differentiate between errors such as invalid zipcode or missing zipcode, therefore the new message is not displayed (isErrorGetter stays true). That also explains #6399 #6440 (and maybe #6443?)

A dirty fix is to remove https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L639-L642 but there might be other problems because of that.


Reply to this email directly or view it on GitHub: https://github.com/angular/material/issues/6610#issuecomment-172092528 ----==_mimepart_56995f60aa8be_3f7a3fbf0dae72a080978e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

I think I found the problem:

https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L639-L642 says If we have the md-auto-hide class, the md-input-invalid animation will fire, so we can skip. However, it does not.

The animation is supposed to be triggered by the setInvalid function
https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L86

setInvalid is triggered by scope.$watch(isErrorGetter, containerCtrl.setInvalid);

It cannot differentiate between errors such as invalid zipcode or missing zipcode, therefore the new message is not displayed (isErrorGetter stays true). That also explains #6399 #6440 (and maybe #6443?)

A dirty fix is to remove https://github.com/angular/material/blob/1d71928ee7480464d34749284cb326d3ad127f93/src/components/input/input.js#L639-L642 but there might be other problems because of that.

—
Reply to this email directly or view it on GitHub.

----==_mimepart_56995f60aa8be_3f7a3fbf0dae72a080978e--

yanndupuy avatar Jan 15 '16 21:01 yanndupuy

This issue is closed as part of our ‘Surge Focus on Material 2' efforts. For details, see our forum posting @ http://bit.ly/1UhZyWs.

ThomasBurleson avatar Jun 02 '16 13:06 ThomasBurleson