ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

No `:part()` support for Timeline and TimelineItem components

Open lv-sap opened this issue 5 years ago • 6 comments

Bug Description

React components ui5-webcomponents/packages/fiori/src/Timeline.hbs and ui5-webcomponents/packages/fiori/src/TimelineItem.hbs do not have support for the part pseudo element, currently. Ex: See https://github.com/SAP/ui5-webcomponents/blob/684ccbf995b4cdd8f0db25bb952c3ebebbcd5d0e/packages/fiori/src/TimelineItem.hbs.

Expected Behavior

It would be helpful if these components support for the part pseudo element, as well

Priority

  • [ ] Low
  • [x] Medium
  • [ ] High
  • [ ] Very High

lv-sap avatar Jun 08 '21 05:06 lv-sap

Hi @lv75 ,

Indeed, the Timeline and TimelineItem do not have part support currently, but could you explain your use case and also what "parts" do you want to be included?

Kind Regards, Elena

elenastoyanovaa avatar Jun 08 '21 07:06 elenastoyanovaa

Hi Elena,

By default, the Timeline's and TimelineItem's shadow DOM elements, such asui5-tli-title, ui5-tli-subtitle and ui5-tli-desc, do not wrap the text that is longer than the width of the component. Instead, these elements simply chop the long text and display it on a single line. This behavior is not always desired, as there are cases when it is necessary to wrap these texts on multiple lines, as in this screenshot: Screen Shot 2021-06-08 at 7 25 32 PM

However, the component does not provide an API to achieve this, so the easier option would be use the :part attribute (pseudo element) to modify the CSS styling of these shadow DOM elements. So, I think it will be useful if all main shadow DOM elements of these components would support the ':part' attribute for situations such as this, when it is really necessary to intentionally pierce the shadow DOM and modify component's default styling.

Thanks and Best Regards,

  • Lucian

lv-sap avatar Jun 09 '21 02:06 lv-sap

Hi @SAP/ui5-webcomponents-team ,

The reported issue is related the timeline/timeline item web components. The reporter wants to enable wrapping on ui5-tli-title, ui5-tli-subtitle and ui5-tli-desc level via :part support.

The issue is reproducible in the playground https://sap.github.io/ui5-webcomponents/master/playground/components/Timeline/ If you change the title, subtitle text with a longer string value and you make the viewport smaller, you will see that the text get cut. The desired behavior is for the text to wrap.

I am not sure if this should be considered a bug, since the reporter suggests support for ":part" attribute for all main shadow DOM elements, where necessary.

Could you please have a look?

Kind Regards, Elena

elenastoyanovaa avatar Jun 09 '21 07:06 elenastoyanovaa

Hi @lv75

As much as I can understand, you wish to control only the truncating/wrapping behaviour of all the texts. If so I can propose another solution that is future proof and won't need any additional work on your side.

We can implement a wrappingType property on ui5-timeline-item level, which will control the wrapping/truncating behaviour of all texts. The downside of this approach would be the fact that you will not be able to control any other CSS properties.

If this is the case(you only want to control the truncating/wrapping behaviour), we will implement the wrappingType property. Can you confirm that you only want to control the truncating/wrapping behaviour and nothing else?

fifoosid avatar Jun 09 '21 10:06 fifoosid

Hi @lv75

Do you still need these requirements or should we close the feature request?

fifoosid avatar Jul 23 '21 11:07 fifoosid

Closing due to inactivity.

ilhan007 avatar Jul 27 '21 06:07 ilhan007