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

Add <slot name="user-msg"> #240

Merged
merged 8 commits into from
Jun 19, 2023
Merged

Add <slot name="user-msg"> #240

merged 8 commits into from
Jun 19, 2023

Conversation

janosh
Copy link
Owner

@janosh janosh commented Jun 19, 2023

This slot is displayed when allowUserOptions && searchText is truthy.

Has prop msg that will be duplicateOptionMsg if !duplicates && textInputIsDuplicate (i.e. duplicates are not allowed and the user-entered searchText is a duplicate) else createOptionMsg.

Details
{@const textInputIsDuplicate = selected.map(get_label).includes(searchText)}
{@const msg =
  !duplicates && textInputIsDuplicate ? duplicateOptionMsg : createOptionMsg}
{#if allowUserOptions && searchText && msg}
  <li
    on:mousedown|stopPropagation
    on:mouseup|stopPropagation={(event) => add(searchText, event)}
    title={createOptionMsg}
    class:active={option_msg_is_active}
    on:mouseover={() => (option_msg_is_active = true)}
    on:focus={() => (option_msg_is_active = true)}
    on:mouseout={() => (option_msg_is_active = false)}
    on:blur={() => (option_msg_is_active = false)}
    role="option"
    aria-selected="false"
    class="user-msg"
  >
    <slot
      name="user-msg"
      {duplicateOptionMsg}
      {createOptionMsg}
      {textInputIsDuplicate}
      {searchText}
      {msg}
    >
      {msg}
    </slot>
  </li>

```</details> 

Default coverage provider has changed from "c8" to "v8". New package is required to be installed. To use the old deprecated coverage provider use "--coverage.provider c8" option.
See vitest-dev/vitest#3339 for more information.
fix eslint commit hook
@janosh janosh added the enhancement New feature or request label Jun 19, 2023
@janosh janosh merged commit 06401e4 into main Jun 19, 2023
4 checks passed
@janosh janosh deleted the user-msg-slot branch June 19, 2023 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant