Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- targetHasClickHandler(event) {
- let el = event.target;
- while(el) {
- if (el.getAttribute('data-click-handler')) {
- return true;
- }
- el = el.parentElement;
- }
- return false;
- }
- // on the react component
- onClick={(evt) => {
- if (this.targetHasClickHandler(evt)) {
- return null;
- }
- window.location = contentUrl;
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement