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

Responsive Panel gets affected by TemplateInfo.HtmlFieldPrefix #8057

Closed
eyupyusein opened this issue Nov 21, 2024 · 1 comment
Closed

Responsive Panel gets affected by TemplateInfo.HtmlFieldPrefix #8057

eyupyusein opened this issue Nov 21, 2024 · 1 comment
Assignees
Labels

Comments

@eyupyusein
Copy link
Contributor

To reproduce the issue, open the following REPL sample:
https://netcorerepl.telerik.com/QyFPmlFR39pKo7vQ51

When this setting is present:

@{
    ViewData.TemplateInfo.HtmlFieldPrefix = "message";
}

The responsive panel's id and name attributes are wrongly affected:

Image

The result should be the the same as if the setting was removed:

Image

This unexpected prefix breaks the layout and other custom logic on the page.

@aleksandarevangelatov
Copy link
Contributor

The observed behavior is expected. The framework's DefaultHtmlGenerator.cs relies on the GetFullHtmlfieldName to generate the correct full name for a helper. In a similar approach, the Telerik Helpers rely on the use of the same method when generating the correct full name and id for the components, when an HtmlFieldPrefix is available. Such scenarios include using components in editor templates or in partial views, for example.

The particular report concerns the issue that the selector is changed and custom styling cannot be applied. The scenario can be handled using a CSS Wildcart Selector to target elements regardless of their full name. The condition "ends with" can be used for the scenario in question:

[id$="slidebarl"] {
    // apply styling
}

@github-actions github-actions bot added FP: Completed Sync status with associated Feedback Item and removed FP: Unplanned Sync status with associated Feedback Item labels Nov 28, 2024
@aleksandarevangelatov aleksandarevangelatov added FP: Declined Sync status with associated Feedback Item and removed FP: Completed Sync status with associated Feedback Item labels Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants