Reference Source
import DiscussionComposer from 'flarum/components/DiscussionComposer.js'
public class | source

DiscussionComposer

Extends:

flarum/components/ComposerBody~ComposerBody → DiscussionComposer

The DiscussionComposer component displays the composer content for starting a new discussion. It adds a text field as a header control so the user can enter the title of their discussion. It also overrides the submit and willExit actions to account for the title.

Props

  • All of the props for ComposerBody
  • titlePlaceholder

Static Method Summary

Static Public Methods
public static

initProps(props: *)

Member Summary

Public Members
public
public

The value of the title input.

Method Summary

Public Methods
public

Get the data to submit to the server when the discussion is saved.

public
public

init()

public

onkeydown(e: Event)

Handle the title input's keydown event. When the return key is pressed, move the focus to the start of the text editor.

public
public

Static Public Methods

public static initProps(props: *) source

Params:

NameTypeAttributeDescription
props *

Public Members

public loading: boolean source

public title: Function source

The value of the title input.

Public Methods

public data(): Object source

Get the data to submit to the server when the discussion is saved.

Return:

Object

public headerItems(): * source

Return:

*

public init() source

public onkeydown(e: Event) source

Handle the title input's keydown event. When the return key is pressed, move the focus to the start of the text editor.

Params:

NameTypeAttributeDescription
e Event

public onsubmit() source

public preventExit(): * source

Return:

*