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 hook to selection #47

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Add hook to selection #47

wants to merge 5 commits into from

Conversation

mankowitz
Copy link

I added an overwritable function called processItem that allows the user to process the mention before inserting it in the element

@fritx
Copy link
Owner

fritx commented Mar 25, 2018

@mankowitz good idea.

I guess a corresponding deleteMatch should be defined to use together with processItem??

  deleteMatch: {
    type: Function,
    default: (name, chunk, suffix) => {
      return chunk === name + suffix
    }
  },

@mankowitz
Copy link
Author

@fritx - Can you merge the processItem into the next build?

@fritx
Copy link
Owner

fritx commented Aug 28, 2018

@mankowitz sorry.. but have a look at my previous comments :D

The changes seem to be more than just one feature, I want things to be nailed in certain commits.

And also, I would switch to slot-scope in a separated commit and bump since it would no longer work with Vue 2.4.x

@@ -18,7 +18,7 @@

<at-ta :members="members" name-key="name" v-model="text">
<!-- custom: with avatars -->
<template slot="item" scope="s">
<template slot="item" slot-scope="s">
Copy link
Owner

Choose a reason for hiding this comment

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

Agreed to use slot-scope as a Vue upgrade, 👍
but I've been afraid it would break users that were still using older versions of Vue.

So I'd like to make such changes later in a major bump 😄

@@ -20,6 +20,7 @@
:class="isCur(index) && 'atwho-cur'"
:ref="isCur(index) && 'cur'"
:data-index="index"
:key="index"
Copy link
Owner

Choose a reason for hiding this comment

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

👍

processItem: {
type: Function,
default: (list, cur, suffix) => {
return itemName(list[cur]) + suffix
Copy link
Owner

Choose a reason for hiding this comment

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

I'm afriad the itemName here would be "not defined" 😨

Copy link
Author

Choose a reason for hiding this comment

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

It shouldn’t be undefind. I was able to use it. Maybe add a check first?

Copy link
Owner

@fritx fritx Sep 3, 2018

Choose a reason for hiding this comment

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

oh my bad

Copy link
Owner

Choose a reason for hiding this comment

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

@mankowitz it should be not defined 'cause itemName is defined in methods not in top-level scope.

@fritx
Copy link
Owner

fritx commented Sep 6, 2018

@mankowitz i'm sorry you have deleted the source of this PR and
also there are some conflicts in it that I can not merge it right now.

@fritx fritx added the declined label Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants