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

fix(demo): Fixed routings issue for links with inner html tags. #3816

Merged
merged 2 commits into from Mar 1, 2018
Merged

fix(demo): Fixed routings issue for links with inner html tags. #3816

merged 2 commits into from Mar 1, 2018

Conversation

ghost
Copy link

@ghost ghost commented Feb 16, 2018

Fixed routings issue for links with inner html tags.
this pr should be merged before pr #3812

Closes #3813

@@ -17,7 +17,7 @@ export class ExamplesComponent {

@HostListener('document:click', ['$event'])
preventEmptyHrefNav(event: Event) {
if (event && event.target && (event.target as Element).getAttribute('href') === '#') {
if (event && event.target && (event.target as Element).getAttribute('href') === '#' || event.srcElement.parentElement && (event.srcElement.parentElement as Element).getAttribute('href') === '#') {

This comment was marked as off-topic.

@codecov
Copy link

codecov bot commented Feb 16, 2018

Codecov Report

❗ No coverage uploaded for pull request base (development@e748105). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##             development    #3816   +/-   ##
==============================================
  Coverage               ?   72.03%           
==============================================
  Files                  ?      252           
  Lines                  ?     8159           
  Branches               ?     1552           
==============================================
  Hits                   ?     5877           
  Misses                 ?     1859           
  Partials               ?      423

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e748105...daeef6e. Read the comment docs.

@ghost ghost changed the title fix(demo): fix dropdown link fix(demo): Fixed routings issue for links with inner html tags. Feb 16, 2018
element = element.parentElement;
linkPrevent = event && element && (element as Element).getAttribute('href') === '#';
}
} else {

This comment was marked as off-topic.

if (event && event.target && (event.target as Element).getAttribute('href') === '#') {
event.preventDefault();
preventEmptyHrefNav(event: Event): void {
let element = event.srcElement;

This comment was marked as off-topic.

if (event && event.target && (event.target as Element).getAttribute('href') === '#') {
preventEmptyHrefNav(event: Event): any {
let element: any = event.target;
let linkPrevent = event && element.getAttribute('href') === '#';

This comment was marked as off-topic.

if (event && event.target && (event.target as Element).getAttribute('href') === '#') {
preventEmptyHrefNav(event: Event): any {
let element: any = event.target;
let preventNav = event && element.getAttribute('href') === '#';

This comment was marked as off-topic.

return;
}
element = element.parentElement;
preventNav = event && element.getAttribute('href') === '#';

This comment was marked as off-topic.

IlyaSurmay
IlyaSurmay previously approved these changes Feb 21, 2018
@YevheniiaMazur
Copy link

Tested, looks good

preventEmptyHrefNav(event: Event) {
if (event && event.target && (event.target as Element).getAttribute('href') === '#') {
preventEmptyHrefNav(event: Event): any {
let element: any = event.target;

This comment was marked as off-topic.

@ghost
Copy link
Author

ghost commented Feb 23, 2018

@valorkin fixed it

@ghost ghost assigned valorkin Mar 1, 2018
@ghost ghost added the in progress label Mar 1, 2018
@valorkin valorkin merged commit 5869afb into valor-software:development Mar 1, 2018
@ghost ghost removed the in progress label Mar 1, 2018
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.

3 participants