Disable context menu in timepicker's up & down arrow
Right now, right clicking on up or down arrow starts the counter
while also showing the default context menu for browsers. This
commit disables the context menu & makes the right click
behavior identical to left click.
| | |
| | | } |
| | | } |
| | | return React.createElement('div', { key: type, className: 'rdtCounter' }, [ |
| | | React.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'increase', type ) }, '▲' ), |
| | | React.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'increase', type ), onContextMenu: this.disableContextMenu }, '▲' ), |
| | | React.createElement('div', { key: 'c', className: 'rdtCount' }, value ), |
| | | React.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'decrease', type ) }, '▼' ) |
| | | React.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'decrease', type ), onContextMenu: this.disableContextMenu }, '▼' ) |
| | | ]); |
| | | } |
| | | return ''; |
| | |
| | | |
| | | renderDayPart: function() { |
| | | return React.createElement('div', { key: 'dayPart', className: 'rdtCounter' }, [ |
| | | React.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours') }, '▲' ), |
| | | React.createElement('span', { key: 'up', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▲' ), |
| | | React.createElement('div', { key: this.state.daypart, className: 'rdtCount' }, this.state.daypart ), |
| | | React.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours') }, '▼' ) |
| | | React.createElement('span', { key: 'do', className: 'rdtBtn', onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▼' ) |
| | | ]); |
| | | }, |
| | | |
| | |
| | | }; |
| | | }, |
| | | |
| | | disableContextMenu: function( event ) { |
| | | event.preventDefault(); |
| | | return false; |
| | | }, |
| | | |
| | | padValues: { |
| | | hours: 1, |
| | | minutes: 2, |
| | |
| | | className="rdtCounter"> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▲ |
| | | </span> |
| | |
| | | </div> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▼ |
| | | </span> |
| | |
| | | className="rdtCounter"> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▲ |
| | | </span> |
| | |
| | | </div> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▼ |
| | | </span> |
| | |
| | | className="rdtCounter"> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▲ |
| | | </span> |
| | |
| | | </div> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▼ |
| | | </span> |
| | |
| | | className="rdtCounter"> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▲ |
| | | </span> |
| | |
| | | </div> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▼ |
| | | </span> |
| | |
| | | className="rdtCounter"> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▲ |
| | | </span> |
| | |
| | | </div> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▼ |
| | | </span> |
| | |
| | | className="rdtCounter"> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▲ |
| | | </span> |
| | |
| | | </div> |
| | | <span |
| | | className="rdtBtn" |
| | | onContextMenu={[Function]} |
| | | onMouseDown={[Function]}> |
| | | ▼ |
| | | </span> |