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(ui5-panel): enable configuring the heading level #1504

Merged
merged 2 commits into from
Apr 21, 2020

Conversation

ilhan007
Copy link
Member

Background
Our native title used to be "h1", which is indeed wrong. In openui5 it is "h2" and it is not configurable. But, in the related issue the author wants to be able to change the title level in general. Although we provide the possibility of a custom header, the author is asking for this feature to make use of the fact that the the entire native header is clickable and focusable, which is not the case with the custom one.

Options
So, we either reject this and (1) hardcode it to "h2" as in openui5, (2) introduce a property as in this change, or (3) make another slot for the title, but then we will have the current "header" slot and "headerTitle" slot and it might be confusing.

In this change:

  • [refactoring] Use div with role="heading" and "aria-level" attrs, instead of "h" tag to enable the configuration of the level. Reuse the existing TitleLevel enum ("H1" to "H6") and extract the number part, but AriaLevel type ("1" - "6") is also an option.
  • [FIX] sync the parameters in the latest visual design and change few variables
  • [FIX] title now truncates, previously it used to wrap.

Fixes: #1495

@ilhan007 ilhan007 requested a review from vladitasev April 21, 2020 10:13
@ilhan007 ilhan007 merged commit 710053b into master Apr 21, 2020
@ilhan007 ilhan007 deleted the fix-panel-heading branch April 21, 2020 10:54
ilhan007 added a commit that referenced this pull request Apr 22, 2020
**Background**
Our native title used to be "h1", which is indeed wrong. In openui5 it is "h2" and it is not configurable. But, in the related issue the author wants to be able to change the title level in general. Although we provide the possibility of a custom header, the author is asking for this feature to make use of the fact that the the entire native header is clickable and focusable, which is not the case with the custom one.
**Options**
So, we either reject this and (1) hardcode it to "h2" as in openui5, (2) introduce a property as in this change, or (3) make another slot for the title, but then we will have the current "header" slot and "headerTitle" slot and it might be confusing.
**In this change:**
- [refactoring] Use div with role="heading" and "aria-level" attrs, instead of "h" tag to  enable the configuration of the level. Reuse the existing TitleLevel enum ("H1" to "H6") and extract the number part, but AriaLevel type ("1" - "6") is also an option.
- [FIX] sync the parameters in the latest visual design and change few variables
- [FIX] title now truncates, previously it used to wrap.

Fixes: #1495
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.

ui5-panel: supports the change of header level in the default header of ui5-panel
3 participants