fix: Use placeholer attr to set color placeholder instead of value

This commit is contained in:
Suraj Shetty 2021-04-29 17:41:48 +05:30
parent f148bf36c3
commit b1d6e7ad16
2 changed files with 3 additions and 3 deletions

View file

@ -6,6 +6,7 @@ frappe.ui.form.ControlColor = frappe.ui.form.ControlData.extend({
this.make_color_input();
},
make_color_input: function () {
this.df.placeholder = __('Choose a color');
let picker_wrapper = $('<div>');
this.picker = new Picker({
parent: picker_wrapper[0],
@ -83,8 +84,7 @@ frappe.ui.form.ControlColor = frappe.ui.form.ControlData.extend({
},
set_formatted_input: function(value) {
this._super(value);
this.$input.val(value || __('Choose a color'));
this.$input.val(value);
this.selected_color.css({
"background-color": value || 'transparent',
});

View file

@ -422,7 +422,7 @@ export default class GridRow {
field.$input
.addClass('input-sm')
.attr('data-col-idx', column.column_index)
.attr('placeholder', __(df.label));
.attr('placeholder', __(df.placeholder || df.label));
// flag list input
if (this.columns_list && this.columns_list.slice(-1)[0]===column) {
field.$input.attr('data-last-input', 1);