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

feat: add console warning for misused ion-menu contentId #23810

Closed
3 tasks done
willmartian opened this issue Aug 24, 2021 · 3 comments
Closed
3 tasks done

feat: add console warning for misused ion-menu contentId #23810

willmartian opened this issue Aug 24, 2021 · 3 comments
Labels
help wanted a good issue for the community package: core @ionic/core package type: feature request a new feature, enhancement, or improvement
Milestone

Comments

@willmartian
Copy link
Contributor

Prequisites

Describe the Feature Request

Add a console warning for when the contentId of an ion-menu is set to the id of the menu's inner ion-content.

Describe the Use Case

The contentId property is frequently misapplied. This is already mentioned in the docs (here); adding a console warning might help prevent this issue.

Describe Preferred Solution

When the inner ion-content's id is equal to its parent's contentId, we should trigger a console.warn.

An example of a warning in another component can be seen here:

console.warn('split pane cannot have more than one main node');

Describe Alternatives

No response

Related Code

The following code snippet is a common error that will result in the ion-menu not behaving correctly.

<ion-menu contentId="my-content">
  <ion-content id="my-content"></ion-content>
</ion-menu>

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Aug 24, 2021
@willmartian willmartian added package: core @ionic/core package type: feature request a new feature, enhancement, or improvement labels Aug 24, 2021
@ionitron-bot ionitron-bot bot removed the triage label Aug 24, 2021
@willmartian willmartian added the help wanted a good issue for the community label Aug 24, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Aug 24, 2021

This issue has been labeled as help wanted. This label is added to issues that we believe would be good for contributors.

If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort.

For a guide on how to create a pull request and test this project locally to see your changes, see our contributing documentation.

Thank you!

@willmartian willmartian changed the title feat: add console warning for misused ion-menu ids feat: add console warning for misused ion-menu contentId Aug 24, 2021
@willmartian
Copy link
Contributor Author

Resolved in v6 of Framework :)

@liamdebeasi liamdebeasi added this to the 6.0.0-beta.6 milestone Sep 13, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Oct 13, 2021

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted a good issue for the community package: core @ionic/core package type: feature request a new feature, enhancement, or improvement
Projects
None yet
Development

No branches or pull requests

2 participants