nextcloud-vue
nextcloud-vue copied to clipboard
Add a 'clear' option to `NcColorPicker`
Would be nice to have a 'Clear' button inside of NcPopover to be able to reset color, which has been set up before. Same could be applied for the second click on picked color (unselect)
Source code: https://github.com/nextcloud/nextcloud-vue/blob/master/src/components/NcColorPicker/NcColorPicker.vue
Important:
Current upstream library (Chrome component) does not support undefined as a color value.
[Vue warn]: Error in render: "TypeError: this.colors is undefined"
found in
---> <Chrome> at src/components/Chrome.vue
Something neutral should be passed:
- empty string
- fallback color
- neutral color (black, white)
- default color (Nc blue or defaultPallete[0]
@Antreesy @susnux if there is currently no color selected, the advanced fields won't work. So the 'clear' button is only a good idea after the bug is fixed.
[Vue warn]: Error in render: "TypeError: this.colors is undefined"
and
[Vue warn]: Error in data(): "TypeError: e3 is undefined"
found in
---> <Chrome> at src/components/Chrome.vue
<VPopperContent>
<VPopper>
<VDropdown>
<NcPopover>
<NcColorPicker>
[Vue warn]: Error in render: "TypeError: this.colors is undefined"
modelValue | A HEX color that represents the initial value of the picker | string - required
undefined is atm not supported by a component. Would setting an empty string work for you, @Chartman123 ?
@Antreesy yes, empty string works for me :) I can handle the 'null' for/from the backend in the code 👍🏻