UX: Add simple-list setting type (PR #9970)

please use @action

      return values.split(delimiter).filter(Boolean);

indentation of both is wrong here

indentation is wrong

why 0px and not 0 ?

can we use a class please?

can we use a class please?

Hmm, I was forced to do this by pre-commit hooks though, before I had this indentation, there were linting issues:

image

I copied the styles from the value-list SCSS, but found that this was an IE11 fix:

https://github.com/discourse/discourse/commit/ba5e17a7a98af178c75d00d7be817c471fc88911

I know we don’t support IE11 anymore, but I would keep this as 0px for consistency.

correct indentation is:

{{input
  title=value
  value=value
  class="value-input"
  focus-out=(action "changeValue" index)
}}

:+1:

guess it would be cleaner to stop the event here if we do something with it

I’m unsure this has value as a fn here given we only use it once

I’m unsure this has value as a fn here given we only use it once

and same thing for _addValue

I would rather want to have an onChange event, instead of mutating this inside the component, values should be read only inside the component, given it’s coming from outside the component.

AFAIK keyCode is getting deprecated, I know we use it the app, but well if we are writing new code, maybe we should avoid it.

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode

This is something slightly concerning that you are mixing KVO stuff (removeObject) and non KVO stuff (replace) it all works because in the end you do a set I guess.

Maybe you should consider calling arrayContentDidChange when doing replace, this way it will be consistent: https://api.emberjs.com/ember/3.18/classes/MutableArray/methods/removeObject?anchor=removeObject

Thanks @jjaffeux, the last commit should address most of the outstanding items. I also removed support for inputType == array, that pattern is only used in user fields and I think it should be handled outside of the component (in a future PR).

Minor comment, how does the interface scale as the list grows? Do we collapse the list at some point?