corysimmons
corysimmons

Reputation: 7695

Disable drag selection on react-big-calendar

I don't see anything in API for disabling this behavior.

I just want users to have to click on a specific date.

Upvotes: 2

Views: 2790

Answers (2)

Vivek V C
Vivek V C

Reputation: 15

I had to get selection for clicked date, without drag. Used the onSelectSlot with required logic.

onSelectSlot={(e) => {
  if (e.slots?.length > 1) return; // or a message
  alert("onSelectSlot" + JSON.stringify(e));
}}

Note: this wont handle drag selection styling!!

Upvotes: 0

Morris
Morris

Reputation: 1124

use the prop onSelecting. For example: onSelecting = {slot => false}

Upvotes: 4

Related Questions