Skip to content
Snippets Groups Projects
Commit 793988c7 authored by Nicolas Lempereur's avatar Nicolas Lempereur
Browse files

[FIX] web_editor: normal up/down in content in cell

In the editor in a table cell, when we press UP/DOWN keys:

- we have default editor/browser behavior if there is content before
  (UP) or after (DOWN) the element we are currently on
- else we go to the previous (UP) or next (DOWN) row if available
- else we go to the next content if available
- else we have the default editor/browser behavior

But when checking if there is an element before/after the content, we
did not take into account if there was an ancestor node inside the cell
that had content after, so for example with this structure:

```
<table>
<tr><td>
  <p>hello <b>world</b></p>
  <p>cruel</p>
</td></tr>
<tr><td>
  <p>bingo</p>
</td></tr>
</table>
```

if the current range was on 'world' text node, we would just check if
there is content after this text node, not if there is content after its
`<p/>` ancestor.

Before the fix we would get on the next row, after we would have default
editor/browser behavior: ie. if cruel is on another line, going to this
line.

opw-1870119
closes #26701
parent b5471da2
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment