search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Possibility to prevent the text to get highlighted when start editing an event with Scheduler.control.events.edit(event)

Asked by Anonymous
21 days ago.

I’m currently implementing inline edit in a react app, when props change from outside during an edit and the scheduler re-renders, I need to reenter the edit, which works just fine with Scheduler.control.events.edit(event), but the text is highlighted, is there an option to enter the edit mode without the text highlighted or would it posible to add this as an option when calling Scheduler.control.events.edit(event)?

Answer posted by Dan Letecky [DayPilot]
21 days ago.

You can cancel the selection and place the caret at the start using the onAfterEventEditRender event:

onAfterEventEditRender: args => {
  setTimeout(() => {
    args.element.setSelectionRange(0, 0);
  }, 0);
}

This event is called before the text is selected so you need to postpone the setSelectionRange() call using setTimeout().

Comment posted by Anonymous
15 days ago.

Thanks for the quick reply this works for me!

New Reply
This reply is
Attachments:
or drop files here
Your name (optional):