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(list-item): Add content slot for specialized content #5876

Merged
merged 6 commits into from
Dec 5, 2022

Conversation

driskull
Copy link
Member

@driskull driskull commented Dec 2, 2022

Related Issue: #3032

Summary

feat(list-item): Add slot for specialized content #3032

  • Adds a new content slot to the list-item for customized content.
  • content slot takes precedence over label and description properties.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Dec 2, 2022
@driskull driskull changed the title feat(list-item): Add slot for specialized content feat(list-item): Add "content" slot for specialized content Dec 2, 2022
@driskull driskull changed the title feat(list-item): Add "content" slot for specialized content feat(list-item): Add content slot for specialized content Dec 2, 2022
@driskull driskull marked this pull request as ready for review December 2, 2022 18:42
@driskull driskull requested a review from a team as a code owner December 2, 2022 18:42
@driskull driskull added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Dec 2, 2022
Copy link
Member

@benelan benelan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is funky with the focus when using the content slot. You can repro in the story after removing the disabled attributes, or put this at the end of the list demo:

    <!-- custom content -->
    <div class="parent">
      <style>
        .list-chip {
          margin-inline-end: 0.5rem;
        }
      </style>

      <div class="child right-aligned-text">custom content</div>
      <div class="child">
        <calcite-list>
          <calcite-list-item>
            <div slot="content">
              <strong>Cras iaculis ultricies nulla.</strong>
              <div>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>
            </div>
          </calcite-list-item>
          <calcite-list-item>
            <div slot="content">
              <strong>Cras iaculis ultricies nulla.</strong>
              <div>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>
            </div>
          </calcite-list-item>
          <calcite-list-item>
            <div slot="content">
              <strong>Cras iaculis ultricies nulla.</strong>
              <div>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>
            </div>
          </calcite-list-item>
        </calcite-list>
      </div>
    </div>

For the most part, I can't get the focus ring to show up when clicking or tabbing. However if you click/tab for long enough the focus ring will eventually show up on one of the items. I also noticed some inconsistent focus ring behavior for the "start/end content slots" demo, so it might not be completely related to this PR. But the content slot focus behavior seems a lot worse

src/components/list-item/list-item.tsx Outdated Show resolved Hide resolved
@driskull
Copy link
Member Author

driskull commented Dec 5, 2022

Something is funky with the focus when using the content slot. You can repro in the story after removing the disabled attributes, or put this at the end of the list demo:

@benelan can you create an issue for this one? I do see the problem.

Copy link
Member

@benelan benelan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I confirmed it's reproducible on our next storybook deployment, so it isn't a result of the changes in this PR.
https://esri.github.io/calcite-components/?path=/story/components-list--start-and-end-content-slots

If you rather address it in a different PR I'm okay with that; I'll create an issue. Other than that and the doc nitpick, LGTM

@driskull
Copy link
Member Author

driskull commented Dec 5, 2022

If you rather address it in a different PR I'm okay with that; I'll create an issue. Other than that and the doc nitpick, LGTM

Yeah, it would be easier to track and report that way 👍

@driskull driskull added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Dec 5, 2022
@driskull driskull merged commit a510773 into master Dec 5, 2022
@driskull driskull deleted the dris0000/list-custom-content branch December 5, 2022 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants