diff --git a/res/css/views/dialogs/_PollCreateDialog.scss b/res/css/views/dialogs/_PollCreateDialog.scss index d873ec44ef..358c95a2bf 100644 --- a/res/css/views/dialogs/_PollCreateDialog.scss +++ b/res/css/views/dialogs/_PollCreateDialog.scss @@ -15,6 +15,16 @@ limitations under the License. */ .mx_PollCreateDialog { + .mx_PollCreateDialog_busy { + position: absolute; + left: 0px; + right: 0px; + top: 0px; + bottom: 0px; + background-color: rgba($background, 0.6); + z-index: 1; + } + h2 { font-weight: 600; font-size: $font-15px; diff --git a/src/components/views/elements/PollCreateDialog.tsx b/src/components/views/elements/PollCreateDialog.tsx index 7df62090ab..9ef02212bc 100644 --- a/src/components/views/elements/PollCreateDialog.tsx +++ b/src/components/views/elements/PollCreateDialog.tsx @@ -23,6 +23,7 @@ import { arrayFastClone, arraySeed } from "../../../utils/arrays"; import Field from "./Field"; import AccessibleButton from "./AccessibleButton"; import { makePollContent, POLL_KIND_DISCLOSED, POLL_START_EVENT_TYPE } from "../../../polls/consts"; +import Spinner from "./Spinner"; interface IProps extends IDialogProps { room: Room; @@ -118,6 +119,7 @@ export default class PollCreateDialog extends ScrollableBaseModal

{ _t("Create options") }

{ @@ -129,20 +131,26 @@ export default class PollCreateDialog extends ScrollableBaseModal this.onOptionChange(i, e)} usePlaceholderAsHint={true} + disabled={this.state.busy} /> this.onOptionRemove(i)} className="mx_PollCreateDialog_removeOption" + disabled={this.state.busy} /> ) } = MAX_OPTIONS} + disabled={this.state.busy || this.state.options.length >= MAX_OPTIONS} kind="secondary" className="mx_PollCreateDialog_addOption" inputRef={this.addOptionRef} >{ _t("Add option") } + { + this.state.busy && +
+ } ; } }