Kaynağa Gözat

Feature: URL input field should provide a placeholder. Closes #109.

Aleksander Nowodzinski 8 yıl önce
ebeveyn
işleme
323a96edfe

+ 1 - 0
packages/ckeditor5-link/src/ui/linkformview.js

@@ -199,6 +199,7 @@ export default class LinkFormView extends View {
 		const labeledInput = new LabeledInputView( this.locale, InputTextView );
 
 		labeledInput.label = t( 'Link URL' );
+		labeledInput.inputView.placeholder = t( 'http://example.com' );
 
 		return labeledInput;
 	}

+ 7 - 1
packages/ckeditor5-link/tests/ui/linkformview.js

@@ -18,7 +18,7 @@ describe( 'LinkFormView', () => {
 	let view;
 
 	beforeEach( () => {
-		view = new LinkFormView( { t: () => {} } );
+		view = new LinkFormView( { t: () => 'http://example.com' } );
 
 		return view.init();
 	} );
@@ -97,6 +97,12 @@ describe( 'LinkFormView', () => {
 			expect( spy.calledOnce ).to.true;
 		} );
 
+		describe( 'url input view', () => {
+			it( 'has placeholder', () => {
+				expect( view.urlInputView.inputView.placeholder ).to.equal( 'http://example.com' );
+			} );
+		} );
+
 		describe( 'template', () => {
 			it( 'has url input view', () => {
 				expect( view.template.children.get( 0 ) ).to.equal( view.urlInputView );