-
-
Notifications
You must be signed in to change notification settings - Fork 73
Conversation
…the link in a new tab
- open a new tab on click link
…spect to cell_selectable, additional test and test flavor
@@ -186,7 +186,7 @@ export default class EdgeFactory { | |||
} | |||
|
|||
private memoizedCreateEdges = memoizeOne(( | |||
active_cell: ICellCoordinates, | |||
active_cell: ICellCoordinates | undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typing information was inaccurate.
@@ -301,6 +301,7 @@ export interface IProps { | |||
tooltip_conditional: ConditionalTooltip[]; | |||
|
|||
active_cell?: ICellCoordinates; | |||
cell_selectable?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New optional prop. If false, user can't select cells and active_cell
and selected_cells
will always be treated as null/empty.
src/dash-table/dash/Sanitizer.ts
Outdated
|
||
const selected_cells = props.cell_selectable ? | ||
props.selected_cells : | ||
defaultProps.selected_cells |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure active_cell
and selected_cells
have default values if not selectable.
const column = visibleColumns[col]; | ||
if (column.presentation !== Presentation.Markdown) { | ||
e.preventDefault(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow click-through to the most nested target element for Markdown cells.
|
||
if (!cell_selectable) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opt out of selection processing if the table doesn't have selectable cells.
@@ -1,14 +1,14 @@ | |||
import { Remarkable } from 'remarkable'; | |||
import LazyLoader from 'dash-table/LazyLoader'; | |||
|
|||
export default class MarkdownHighlighter { | |||
export default class Markdown { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed as this helper doesn't only cover highlights now.
|
||
assert len(test.driver.window_handles) == 1 | ||
target.cell(0, "a").get().find_element_by_css_selector("a").click() | ||
assert len(test.driver.window_handles) == 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only thing I might add here is (1) verify that the new window actually went to google, and (2) switch back to the first window and verify that the cell is selected iff cell_selectable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃 Nice simple API addition and implementation, I like it! Just a small test addition, nonblocking if it turns out to be a pain.
- make sure the cell is selected iif cell_selectable before and after switching tabs
…n if set programmatically
Nice feature, which I was looking for, but it is not working. My app crashes with the following error: |
@FlorianRahe this feature has been merged but not yet released. It will be bundled with the next Dash release in a couple of weeks, or you can follow the steps in CONTRIBUTING.md to install in developer mode if you want to try it today. |
@Marc-Andre-Rivet How does one override the new default |
Closes #710
Changes the behavior of markdown cells so that clicking on the cell both selects the cell and
click through
to the underlying elementChanges the default markdown link target to
target=_blank
to open a new tabNew
cell_selectable
prop (default: True) that turns on/off the ability to select and navigate cells in the table (also overrides value ofactive_cell
andselected_cells
during the sanitation phase)Single click on markdown link opens it
"No selection" table mode