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

[Angular] The page is redirected to the home page of the website after clicking the "Change associated content" button in the Experience Editor in angular application #835

Merged
merged 6 commits into from
Oct 21, 2021

Conversation

CobyPear
Copy link
Contributor

Angular treats anchor tags with href attributes as links and ignores any onclick handlers that may be present on the element in favor of navigating to the href.
Add a workaround so that when using the Experience Editor, Angular properly executes the onclick provided by Experience Editor instead of routing to the href.

Description / Motivation

Experience Editor dropdown buttons were not functioning as expected in the Angular sample app

Testing Details

Check markup in Experience Editor, click on button to see it now behaves as expected

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update (non-breaking change; modified files are limited to the /docs directory)

@CobyPear CobyPear requested a review from a team October 19, 2021 18:33
@vercel
Copy link

vercel bot commented Oct 19, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sitecore-jss/edge-e2e-styleguide/gp6b1hEk7ae8YmkAzuEfncongeSc
✅ Preview: https://edge-e2e-styleguide-git-bugfix-502852-sitecore-jss.vercel.app

samples/angular/src/main.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, please, see some questions

packages/sitecore-jss-angular/src/utils.ts Outdated Show resolved Hide resolved
packages/sitecore-jss-angular/src/utils.ts Outdated Show resolved Hide resolved
packages/sitecore-jss-angular/src/utils.ts Outdated Show resolved Hide resolved
packages/sitecore-jss-angular/src/utils.ts Outdated Show resolved Hide resolved
packages/sitecore-jss-angular/src/utils.ts Outdated Show resolved Hide resolved
samples/angular/src/main.ts Outdated Show resolved Hide resolved
- Use ExperienceEditor class for active editor check
- Change null check for targetNode
Copy link
Contributor

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@CobyPear CobyPear merged commit 103b7a5 into dev Oct 21, 2021
@CobyPear CobyPear deleted the bugfix/502852 branch October 21, 2021 13:19
CobyPear added a commit that referenced this pull request Oct 21, 2021
…r clicking the "Change associated content" button in the Experience Editor in angular application (#835)

* Add workaround for Angular not handling EE onclick

* Change import to angluar pkg

* Move code to utils in angular package

* Add comment to sample

* Refactor based on comments

* More refactoring

- Use ExperienceEditor class for active editor check
- Change null check for targetNode

* Use isExperienceEditorActive method for release/18.0.0 branch

(cherry picked from commit 103b7a5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants