Navigation Menu

Skip to content

Commit

Permalink
Merge branch 't/12465' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Tade0 committed Mar 2, 2017
2 parents 7ee2b8a + 6f7a6e3 commit b6612e6
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -10,6 +10,7 @@ New Features:

Fixed Issues:

* [#12465](http://dev.ckeditor.com/ticket/12465): Fixed: Can't change state of checkboxes/radio buttons if the properties dialog was invoked via double-click.
* [#13062](http://dev.ckeditor.com/ticket/13062): Fixed: Impossible to unlink when the caret is at the edge of the link.
* [#13585](http://dev.ckeditor.com/ticket/13585): Fixed: Error when wrapping two adjacent `<div>`s with a `<div>`.
* [#16866](http://dev.ckeditor.com/ticket/16866): [IE, Edge] Fixed: Whitespaces not preserved when pasting from Word.
Expand Down
11 changes: 9 additions & 2 deletions plugins/forms/dialogs/checkbox.js
Expand Up @@ -116,10 +116,17 @@ CKEDITOR.dialog.add( 'checkbox', function( editor ) {
}
} else {
var value = this.getValue();
if ( value )
// Blink/Webkit needs to change checked property, not attribute. (#12465)
if ( CKEDITOR.env.webkit ) {
element.$.checked = value;
}

if ( value ) {
element.setAttribute( 'checked', 'checked' );
else
}
else {
element.removeAttribute( 'checked' );
}
}
}
},
Expand Down
9 changes: 8 additions & 1 deletion plugins/forms/dialogs/radio.js
Expand Up @@ -2,6 +2,7 @@
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/

CKEDITOR.dialog.add( 'radio', function( editor ) {
return {
title: editor.lang.forms.checkboxAndRadio.radioTitle,
Expand Down Expand Up @@ -87,7 +88,13 @@ CKEDITOR.dialog.add( 'radio', function( editor ) {
var element = data.element;

if ( !CKEDITOR.env.ie ) {
if ( this.getValue() )
var value = this.getValue();
// Blink/Webkit needs to change checked property, not attribute. (#12465)
if ( CKEDITOR.env.webkit ) {
element.$.checked = value;
}

if ( value )
element.setAttribute( 'checked', 'checked' );
else
element.removeAttribute( 'checked' );
Expand Down
13 changes: 13 additions & 0 deletions tests/plugins/forms/manual/checkboxradiochangestate.html
@@ -0,0 +1,13 @@
<body>
<div id="editor">
<p>Example text</p>
</div>

<script>
if ( !CKEDITOR.env.webkit ) {
bender.ignore();
}

CKEDITOR.replace( 'editor' );
</script>
</body>
21 changes: 21 additions & 0 deletions tests/plugins/forms/manual/checkboxradiochangestate.md
@@ -0,0 +1,21 @@
@bender-tags: tc, 4.7.0, 12465, forms
@bender-ui: collapsed
@bender-ckeditor-plugins: forms, wysiwygarea, toolbar

----

1. Click in the editor.
2. Click "Checkbox" button.
3. Check "Selected" field in the dialog and press "Ok" to create a checkbox.
4. Double click the checkbox.
5. Check "Selected" field in the dialog and press "Ok" to modify the checkbox.

**Expected:**
* The state of checkbox is changed.

----

Repeat the same operation with "Radio Button" button.

**Expected:**
* The state of radio button is changed.

0 comments on commit b6612e6

Please sign in to comment.