Hi @aemnewbie
Please create a component specific clientlib which will be loaded only during component authoring and load the below JS file.
(function ($, $document) {
"use strict";
$document.on("dialog-ready", function () {
var title = $(document).attr('title');
var titleFromDialog = $(".my-custom-component").find('input[type=text]').val();
if (titleFromDialog == null || titleFromDialog == "") {
$(".my-custom-component").find('input[type=text]').val(title);
}
});
})($, $(document));
on component cq:dialog node add the property called extraClientlibs and provide the category name of your clientlibs which holds the above code.
Provid a custom class to your dialog field where you want to populate the title i.e. my-custom-component here.
Now when the dialog value is empty, it will show the page title, and if the value is authored in dialog it will show the dialog authored value.
Let me know if there are any questions. Hope this helps!
Please see my response in the below article:
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-set-property-value-of-textfield-using-sightly/m-p/418658#M62
Thanks!