Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8 - use ng-hide in validation directive #9028

Merged

Conversation

nathanwoulfe
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Description

This is a left-over bit from work on #8894. In fiddling with that issue, I found that the showValidationOnSubmit directive used .show() and .hide() to control element visibility. That's all good until we want to change the visibility of the validation messages using the ng-show or ng-hide directive in a view. .show() and .hide() set an inline style attribute, which has higher specificity than the class added by ng-show or ng-hide so it's not possible to control the element visibility outside the events in validation directive.

To fix that, I've removed .show() and .hide() in favour of toggling the ng-hide class name on the outermost element. End result is the same (display property is set to `none!important' but it's done via a class rather than the style attribute, so isn't insanely specific. Also means that we're not mixing jQuery with Angular, which can (this PR as an example) cause unexpected behaviour.

@mikecp mikecp merged commit a314859 into umbraco:v8/contrib Dec 6, 2020
@mikecp
Copy link
Contributor

mikecp commented Dec 6, 2020

Thanks @nathanwoulfe :-)

@mikecp
Copy link
Contributor

mikecp commented Dec 6, 2020

Woops did not see the review request prior to merging :-S

@umbrabot
Copy link

Hi there @nathanwoulfe,

First of all: A big #H5YR for making an Umbraco related contribution during Hacktoberfest! We are very thankful for the huge amount of PRs submitted, and all the amazing work you've been doing 🥇

Due to the amazing work you and others in the community have been doing, we've had a bit of a hard time keeping up. 😅 While all of the PRs for Hacktoberfest might not have been merged yet, you still qualify for receiving some Umbraco swag, congratulations! 🎉

In the spirit of Hacktoberfest we've prepared some exclusive Umbraco swag for all our contributors - including you!

As a new choice this year, you can opt-out of receiving anything and ask us to improve the planet instead by planting a tree on your behalf. 🌳

Receive your swag or plant a tree! 👈 Please follow this link to fill out and submit the form, before February 26, 2021.

Following this date we'll be sending out all the swag, which also means that it might not reach your doorstep before April, so please bear with us and be patient 🙏

The only thing left to say is thank you so much for participating in Hacktoberfest! We really appreciate the help!

Kind regards,
The various Umbraco Teams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants