Enter key on textbox is closing event editor

Im using schedule control and i have a autocomplete textbox inside the event editor. When i type text in the autocomplete, it show me the results, but, when ai nagivation to the item and press Enter Key, the event editor closing. I set allowKeyboardInteraction:false, but not work.

How can i disable the Enter key in this case?

Thank you 

3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team April 12, 2019 06:31 AM UTC

Dear Customer, 
 
Greetings from Syncfusion. 
 
Please use the below code example to achieve your requirement. 
 
popupOpen: function (args) { 
    if (args.type === 'Editor') { 
      var dialogObj = args.element.ej2_instances[0]; 
      dialogObj.buttons[1].buttonModel.isPrimary = false; 
      var statusElement = args.element.querySelector('#EventType'); 
      if (!statusElement.classList.contains('e-autocomplete')) { 
        var autoCompleteObject = new ej.dropdowns.AutoComplete({ 
          placeholder: 'Select a status', value: statusElement.value, 
          dataSource: ['New', 'Requested', 'Confirmed'] 
        }); 
        autoCompleteObject.appendTo(statusElement); 
        statusElement.setAttribute('name', 'EventType'); 
      } 
      var startElement = args.element.querySelector('#StartTime'); 
      if (!startElement.classList.contains('e-datetimepicker')) { 
        new ej.calendars.DateTimePicker({ value: new Date(startElement.value) || new Date() }, startElement); 
      } 
      var endElement = args.element.querySelector('#EndTime'); 
      if (!endElement.classList.contains('e-datetimepicker')) { 
        new ej.calendars.DateTimePicker({ value: new Date(endElement.value) || new Date() }, endElement); 
      } 
    } 
  }, 
 
Regards, 
Karthi 
 



S_ S_Line April 12, 2019 01:36 PM UTC

Thank you very much! it works fine!


KK Karthigeyan Krishnamurthi Syncfusion Team April 15, 2019 03:40 AM UTC

Most welcome 😊 


Loader.
Up arrow icon