DropdownButton (ui/dropdown/button)
@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbutton
The dropdown button interface.
Filtering
Properties
-
class : String
module:ui/dropdown/button/dropdownbutton~DropdownButton#class
inherited observable
(Optional) The additional CSS class set on the button.
-
icon : String
module:ui/dropdown/button/dropdownbutton~DropdownButton#icon
inherited observable
(Optional) An XML content of the icon. When defined, an
iconView
should be added to the button. -
isEnabled : Boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#isEnabled
inherited observable
Controls whether the button view is enabled, i.e. it can be clicked and execute an action.
To change the "on" state of the button, use
isOn
instead.Defaults to
true
-
isOn : Boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#isOn
inherited observable
Controls whether the button view is "on". It makes sense when a feature it represents is currently active, e.g. a bold button is "on" when the selection is in the bold text.
To disable the button, use
isEnabled
instead.Defaults to
true
-
isToggleable : Boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#isToggleable
inherited observable
Controls whether the button view is a toggle button (two–state) for assistive technologies.
Defaults to
false
-
isVisible : Boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#isVisible
inherited observable
Controls whether the button view is visible. Visible by default, buttons are hidden using a CSS class.
Defaults to
true
-
keystroke : Boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#keystroke
inherited observable
(Optional) The keystroke associated with the button, i.e. CTRL+B, in the string format compatible with
keyboard
.Note: Use
withKeystroke
if you want to display the keystroke information next to the label. -
label : String
module:ui/dropdown/button/dropdownbutton~DropdownButton#label
inherited observable
-
labelStyle : String
module:ui/dropdown/button/dropdownbutton~DropdownButton#labelStyle
inherited observable
(Optional) The value of the
style
attribute of the label. -
tabindex : String
module:ui/dropdown/button/dropdownbutton~DropdownButton#tabindex
inherited observable
(Optional) Controls the
tabindex
HTML attribute of the button. By default, the button is focusable but does not included in the Tab order.Defaults to
-1
-
tooltip : Boolean | String | function
module:ui/dropdown/button/dropdownbutton~DropdownButton#tooltip
inherited observable
(Optional) Tooltip of the button, i.e. displayed when hovering the button with the mouse cursor.
-
If defined as a
Boolean
(e.g.true
), then combination oflabel
andkeystroke
will be set as a tooltip. -
If defined as a
String
, tooltip will equal the exact text of thatString
. -
If defined as a
Function
,label
andkeystroke
will be passed to that function, which is to return a string with the tooltip text.const view = new ButtonView( locale ); view.tooltip = ( label, keystroke ) => `A tooltip for ${ label } and ${ keystroke }.`
Defaults to
false
-
-
tooltipPosition : 's' | 'n' | 'e' | 'w' | 'sw' | 'se'
module:ui/dropdown/button/dropdownbutton~DropdownButton#tooltipPosition
inherited observable
(Optional) The position of the tooltip. See
position
to learn more about the available position values.Note: It makes sense only when the
tooltip
attribute is defined.Defaults to
's'
-
type : 'button' | 'submit' | 'reset' | 'menu'
module:ui/dropdown/button/dropdownbutton~DropdownButton#type
inherited observable
The HTML type of the button. Default
button
. -
withKeystroke : Boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#withKeystroke
inherited observable
-
withText : Boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#withText
inherited observable
(Optional) Controls whether the label of the button is hidden (e.g. an icon–only button).
Defaults to
false
Events
-
change:class( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:class
inherited
Fired when the
class
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
class
).value : String
New value of the
class
property with given key ornull
, if operation should remove property.oldValue : String
Old value of the
class
property with given key ornull
, if property was not set before.
-
change:icon( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:icon
inherited
Fired when the
icon
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
icon
).value : String
New value of the
icon
property with given key ornull
, if operation should remove property.oldValue : String
Old value of the
icon
property with given key ornull
, if property was not set before.
-
change:isEnabled( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:isEnabled
inherited
Fired when the
isEnabled
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
isEnabled
).value : Boolean
New value of the
isEnabled
property with given key ornull
, if operation should remove property.oldValue : Boolean
Old value of the
isEnabled
property with given key ornull
, if property was not set before.
-
change:isOn( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:isOn
inherited
Fired when the
isOn
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
isOn
).value : Boolean
New value of the
isOn
property with given key ornull
, if operation should remove property.oldValue : Boolean
Old value of the
isOn
property with given key ornull
, if property was not set before.
-
change:isToggleable( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:isToggleable
inherited
Fired when the
isToggleable
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
isToggleable
).value : Boolean
New value of the
isToggleable
property with given key ornull
, if operation should remove property.oldValue : Boolean
Old value of the
isToggleable
property with given key ornull
, if property was not set before.
-
change:isVisible( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:isVisible
inherited
Fired when the
isVisible
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
isVisible
).value : Boolean
New value of the
isVisible
property with given key ornull
, if operation should remove property.oldValue : Boolean
Old value of the
isVisible
property with given key ornull
, if property was not set before.
-
change:keystroke( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:keystroke
inherited
Fired when the
keystroke
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
keystroke
).value : Boolean
New value of the
keystroke
property with given key ornull
, if operation should remove property.oldValue : Boolean
Old value of the
keystroke
property with given key ornull
, if property was not set before.
-
change:label( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:label
inherited
Fired when the
label
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
label
).value : String
New value of the
label
property with given key ornull
, if operation should remove property.oldValue : String
Old value of the
label
property with given key ornull
, if property was not set before.
-
change:labelStyle( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:labelStyle
inherited
Fired when the
labelStyle
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
labelStyle
).value : String
New value of the
labelStyle
property with given key ornull
, if operation should remove property.oldValue : String
Old value of the
labelStyle
property with given key ornull
, if property was not set before.
-
change:tabindex( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:tabindex
inherited
Fired when the
tabindex
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
tabindex
).value : String
New value of the
tabindex
property with given key ornull
, if operation should remove property.oldValue : String
Old value of the
tabindex
property with given key ornull
, if property was not set before.
-
change:tooltip( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:tooltip
inherited
Fired when the
tooltip
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
tooltip
).value : Boolean | String | function
New value of the
tooltip
property with given key ornull
, if operation should remove property.oldValue : Boolean | String | function
Old value of the
tooltip
property with given key ornull
, if property was not set before.
-
change:tooltipPosition( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:tooltipPosition
inherited
Fired when the
tooltipPosition
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
tooltipPosition
).value : 's' | 'n' | 'e' | 'w' | 'sw' | 'se'
New value of the
tooltipPosition
property with given key ornull
, if operation should remove property.oldValue : 's' | 'n' | 'e' | 'w' | 'sw' | 'se'
Old value of the
tooltipPosition
property with given key ornull
, if property was not set before.
-
change:type( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:type
inherited
Fired when the
type
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
type
).value : 'button' | 'submit' | 'reset' | 'menu'
New value of the
type
property with given key ornull
, if operation should remove property.oldValue : 'button' | 'submit' | 'reset' | 'menu'
Old value of the
type
property with given key ornull
, if property was not set before.
-
change:withKeystroke( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:withKeystroke
inherited
Fired when the
withKeystroke
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
withKeystroke
).value : Boolean
New value of the
withKeystroke
property with given key ornull
, if operation should remove property.oldValue : Boolean
Old value of the
withKeystroke
property with given key ornull
, if property was not set before.
-
change:withText( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:withText
inherited
Fired when the
withText
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
withText
).value : Boolean
New value of the
withText
property with given key ornull
, if operation should remove property.oldValue : Boolean
Old value of the
withText
property with given key ornull
, if property was not set before.
-
execute( eventInfo )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:execute
inherited
-
open( eventInfo )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:open
Fired when the dropdown should be opened. It will not be fired when the button is disabled.
Parameters
eventInfo : EventInfo
An object containing information about the fired event.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.