* Checks if it's possible to create text selection in element. * * @private * @param {HTMLElement} el The element to check. * @returns {boolean}
(el: HTMLElement)
| 1382 | * @returns {boolean} |
| 1383 | */ |
| 1384 | isTextSelectionAllowed(el: HTMLElement) { |
| 1385 | if (isInput(el)) { |
| 1386 | return true; |
| 1387 | } |
| 1388 | |
| 1389 | const isChildOfTableBody = isChildOf(el, this._wt.wtTable.spreader); |
| 1390 | |
| 1391 | if (this.settings.fragmentSelection === true && isChildOfTableBody) { |
| 1392 | return true; |
| 1393 | } |
| 1394 | |
| 1395 | const isSingleCell = this.hot.getSelectedRangeActive()?.isSingleCell() ?? false; |
| 1396 | |
| 1397 | if (this.settings.fragmentSelection === 'cell' && isSingleCell && isChildOfTableBody) { |
| 1398 | return true; |
| 1399 | } |
| 1400 | |
| 1401 | if (!this.settings.fragmentSelection && this.isCellEdited() && isSingleCell) { |
| 1402 | return true; |
| 1403 | } |
| 1404 | |
| 1405 | return false; |
| 1406 | } |
| 1407 | |
| 1408 | /** |
| 1409 | * Checks if user's been called mousedown. |
no test coverage detected