Skip to content

Commit 1a9c17d

Browse files
IlyaSurmayvalorkin
authored andcommitted
fix(demo): add null check in preventEmptyHrefNav method (#3948)
1 parent 5955ca7 commit 1a9c17d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

demo/src/app/docs/demo-section-components/demo-examples-section/examples.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class ExamplesComponent {
2626
}
2727

2828
if (element.tagName !== 'A') {
29-
while (element !== document.body) {
29+
while (element.parentElement && element !== document.body) {
3030
if (preventNav) {
3131
event.preventDefault();
3232
return;

0 commit comments

Comments
 (0)