feat: add console warning for misused ion-menu contentId #23810
Labels
help wanted
a good issue for the community
package: core
@ionic/core package
type: feature request
a new feature, enhancement, or improvement
Milestone
Prequisites
Describe the Feature Request
Add a console warning for when the
contentId
of anion-menu
is set to theid
of the menu's innerion-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
'sid
is equal to its parent'scontentId
, we should trigger aconsole.warn
.An example of a warning in another component can be seen here:
ionic-framework/core/src/components/split-pane/split-pane.tsx
Line 142 in 7315e01
Describe Alternatives
No response
Related Code
The following code snippet is a common error that will result in the
ion-menu
not behaving correctly.Additional Information
No response
The text was updated successfully, but these errors were encountered: