Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Up and down keys skip several lines #7838

Closed
iandunn opened this issue Jul 9, 2018 · 1 comment · Fixed by #7877
Closed

Up and down keys skip several lines #7838

iandunn opened this issue Jul 9, 2018 · 1 comment · Fixed by #7877
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). General Interface Parts of the UI which don't fall neatly under other labels. [Type] Bug An existing feature does not function as intended

Comments

@iandunn
Copy link
Member

iandunn commented Jul 9, 2018

Describe the bug

Sometimes, when using the up and down keys to navigate through text within a block, and across blocks, some lines will be skipped over.

To Reproduce

  1. Paste the following into the code editor, then switch to the visual editor:
<!-- wp:preformatted -->
<pre class="wp-block-preformatted">function mark_as_encoded( $post_ID, $post ) {<br/>  if ( false == $this->encoded || 'revision' == $post->post_type ) {<br/>   return;<br/>  }<br/><br/>  delete_post_meta( $post_ID, 'syntaxhighlighter_encoded' );<em><br/></em>  add_post_meta( $post_ID, '_syntaxhighlighter_encoded', true, true );<br/>}</pre>
<!-- /wp:preformatted -->

<!-- wp:paragraph -->
<p>lorum ipsum blah blah blah here's a long url http://wp-develop.test/wp-admin/edit.php?s=foo&amp;post_status=all&amp;post_type=post&amp;action=-1&amp;m=0&amp;cat=0&amp;paged=1&amp;action2=-1<br/></p>
<!-- /wp:paragraph -->

<!-- wp:preformatted -->
<pre class="wp-block-preformatted"><em>/**<br/></em><em> * @param array $assoc_args Output format arguments.<br/></em><em> * @param array $fields Fields to display of each item.<br/></em><em> * @param string $prefix Check if fields have a standard prefix.<br/></em><em> */<br/></em>public function __construct( &amp;$assoc_args, $fields = null, $prefix = false ) {<br/>$format_args = array(<br/>'format' => 'table',<br/>'fields' => $fields,<br/>'field' => null,<br/>);<br/><br/>foreach ( array( 'format', 'fields', 'field' ) as $key ) {<br/>if ( isset( $assoc_args[ $key ] ) ) {<br/>$format_args[ $key ] = $assoc_args[ $key ];<br/>unset( $assoc_args[ $key ] );<br/>}<br/>}<br/><br/>if ( ! is_array( $format_args['fields'] ) ) {<br/>$format_args['fields'] = explode( ',', $format_args['fields'] );<br/>}<br/><br/>$format_args['fields'] = array_map( 'trim', $format_args['fields'] );<br/><br/>$this->args = $format_args;<br/>$this->prefix = $prefix;<br/>}</pre>
<!-- /wp:preformatted -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
  1. Click in the title to move the cursor there
  2. Press the down key and watch where the cursor moves to. Repeat until you reach the end of the document. You'll notice that several of the lines have been skipped.

Expected behavior

Hitting the up or down key once should only move 1 line, and no lines should be skipped.

Screen capture

https://cloudup.com/cWtcPA1LbI2

Desktop:

  • OS X 10.13.5
  • Firefox Developer Edition 62.0b6
  • Gutenberg master @ e697f72
@iandunn iandunn added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). General Interface Parts of the UI which don't fall neatly under other labels. labels Jul 9, 2018
@iandunn
Copy link
Member Author

iandunn commented Jul 10, 2018

This may be a duplicate of #6524, but I'll leave it open for now in case this contains some cases that wouldn't be solved by the same fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). General Interface Parts of the UI which don't fall neatly under other labels. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant