Skip to content
Snippets Groups Projects

dynamic placeholder,mimetype: code cleanup and documentation fixes

Merged oury.balde requested to merge topic/17.0/ob into branch/17.0
4 files
+ 18
45
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -62,7 +62,4 @@
async handlePlaceholderInsert(chain, defaultValue) {
if (chain) {
this.input.el.focus();
let placeholder = `{{object.${chain}${
defaultValue?.length ? ` ||| ${defaultValue}` : ""
}}}`;
@@ -68,7 +65,9 @@
// Build placeholder based on converter type
let placeholder;
switch (this.activeConverterType) {
case "field":
placeholder = chain;
break;
// Add other converter types here
default:
@@ -69,13 +68,13 @@
switch (this.activeConverterType) {
case "field":
placeholder = chain;
break;
// Add other converter types here
default:
// Default case if no specific converter type is found
placeholder = ` {{object.${chain}${
defaultValue?.length ? ` ||| ${defaultValue}` : ""
}}}`;
const defaultValuePart = defaultValue?.length
? ` ||| ${defaultValue}`
: "";
placeholder = `{{object.${chain}${defaultValuePart}}}`;
break;
}
@@ -90,36 +89,4 @@
this.input.el.focus();
}
},
// async handlePlaceholderValidation(chain, defaultValue) {
// if (chain) {
// this.input.el.focus();
// // Initialize dynamicPlaceholder with a default structure
// let dynamicPlaceholder = ` {{object.${chain}${
// defaultValue?.length ? ` ||| ${defaultValue}` : ""
// }}}`;
// switch (this.converter) {
// case "field":
// // For "field" converter, use the chain directly as the value
// dynamicPlaceholder = `${chain}`;
// break;
// default:
// // Default case if no specific converter type is found
// dynamicPlaceholder = ` {{object.${chain}${
// defaultValue?.length ? ` ||| ${defaultValue}` : ""
// }}}`;
// break;
// }
// this.input.el.setRangeText(
// dynamicPlaceholder,
// this.selectionStart,
// this.selectionStart,
// "end"
// );
// // trigger events to make the field dirty
// this.input.el.dispatchEvent(new InputEvent("input"));
// this.input.el.dispatchEvent(new KeyboardEvent("keydown"));
// this.input.el.focus();
// }
// },
});
Loading