-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from CrowdStrike/improve-navigation
chore: if target is not <a> element, don't handle onClick event
- Loading branch information
Showing
3 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
'@crowdstrike/foundry-js': minor | ||
--- | ||
|
||
Improve how we handle onClick for navigation. Now when adding event listener to click event: | ||
|
||
```javascript | ||
document.querySelector('[data-internal-links]') | ||
.addEventListener('click', (event) => falcon.navigation.onClick(event, '_self', 'internal')); | ||
``` | ||
|
||
we'll call preventDefault correctly and won't throw error in the console. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters