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

List: NoDataText attribute doesn't show text on screen

Open gibiovana opened this issue 6 years ago • 6 comments

Describe the bug Using a List, the NoDataText attribute should show a message on the screen when the list is empty. The current behaviour does not show anything.

Isolated Example In the UI, we are showing a list of Cards. But when there is nothing to show and the list is empty, there is no message on the screen.

To Reproduce Steps to reproduce the behavior:

  1. Create a List
  2. Add 'noDataText' with any String
  3. There should be no text in the UI

Expected behavior When I have an empty list, there should be a message, using NoDataText

Screenshots UI: Screen Shot 2020-10-19 at 10 39 46

The List using NoDataText: Screen Shot 2020-10-19 at 10 50 40

The empty list without the text: Screen Shot 2020-10-19 at 10 40 58 Screen Shot 2020-10-19 at 10 53 13

UI5 Web Components for React Information @ui5/webcomponents version:1.0.0-rc.8 @ui5/webcomponents-react version:^0.10.9 Operating System: MAC OS Browser: Chrome

gibiovana avatar Oct 19 '20 13:10 gibiovana

Hey @gibiovana, thanks for reporting. Would it be possible for you to create a codesandbox demonstrating this issue? I just tried to create one but I looks fine from a first look - did I miss something? https://codesandbox.io/s/pedantic-rosalind-47lm9?file=/src/App.js

MarcusNotheis avatar Oct 19 '20 14:10 MarcusNotheis

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Inactive issues will be closed after 30 days. Thanks.

github-actions[bot] avatar Nov 10 '20 01:11 github-actions[bot]

Its a thing with webcomponent self. I have same issue with angular app.

nazarkulyk avatar Nov 12 '20 10:11 nazarkulyk

Thanks for following up, then I'll forward this issue to the corresponding repo.

MarcusNotheis avatar Nov 12 '20 11:11 MarcusNotheis

@MarcusNotheis here an angular example for that:

codesandbox

to reproduce.

nazarkulyk avatar Nov 12 '20 11:11 nazarkulyk

Hi everyone,

  1. When it comes to Angular, I found two things. First of all the syntax in the provided codesandbox is not correct. When you are binding a property, you don't need the square brackets around the variable name. Those are only needed when it comes to interpolation. Secondly, when you need to bind a kebab-case property, you need to convert it to camelCase. In our case, this means that the code for the ui5-list would look like this:
<ui5-list
    class="full-width"
    header-text="Products"
    [noDataText]="noDataText"
    separators="None"
  ></ui5-list>

The same logic should apply if we want to bind the header-text property of the list.

  1. When it comes to pure React + UI5 Web Components, looks like everything is working as expected. The following code snippet works:
 <ui5-list
          class="full-width"
          header-text="Products"
          no-data-text={noDataText}
          separators="None"
        ></ui5-list>

Moreover, the exact snippet from the initial issue works on my side as well on the current master version of UI5 Web Components:

 <ui5-list
          class="full-width"
          header-text="Products"
          no-data-text={'Some Cool Text here'}
          separators="None"
        ></ui5-list>
  1. When it comes to pure React + UI5 Web Components for React, everything seems to work as expected as well: https://codesandbox.io/s/wandering-grass-ve3y1?file=/src/App.js

I am closing the issue as everything seems to work as expected. If you think that I am missing something, please reopen the issue.

fifoosid avatar Nov 12 '20 15:11 fifoosid