Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow users to change the frame of the first key, ensuring that th… #12622

Merged
merged 1 commit into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface ITextInputComponentProps {
isNumber?: boolean;
complement?: string;
onValueAsNumberChanged?: (value: number, isFocused: boolean) => void;
disabled?: boolean;
}

interface ITextInputComponentState {
Expand Down Expand Up @@ -103,6 +104,7 @@ export class TextInputComponent extends React.Component<ITextInputComponentProps
onKeyPress={(evt) => this._onKeyPress(evt)}
value={(this.state.value || "") + (!this.state.isFocused && this.props.complement ? this.props.complement : "")}
id={this.props.id}
disabled={this.props.disabled}
></input>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class RangeFrameBarComponent extends React.Component<IRangeFrameBarCompon
}

private _buildActiveFrame() {
if (this.props.context.activeFrame !== null && this.props.context.activeFrame !== undefined) {
deltakosh marked this conversation as resolved.
Show resolved Hide resolved
if (this.props.context.activeFrame === null || this.props.context.activeFrame === undefined) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,10 @@
&:focus {
outline: none;
}

&:disabled {
background: #444444;
border: #555555 solid 1px;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ export class TopBarComponent extends React.Component<ITopBarComponentProps, ITop
value={this.state.keyFrameValue}
tooltip="Frame"
id="key-frame"
onValueAsNumberChanged={(newValue) => this.props.context.onFrameManuallyEntered.notifyObservers(newValue)}
onValueAsNumberChanged={(newValue) => {
if (newValue !== 0) {
this.props.context.onFrameManuallyEntered.notifyObservers(newValue);
}
}}
globalState={this.props.globalState}
context={this.props.context}
disabled={parseFloat(this.state.keyFrameValue) === 0}
/>
<TextInputComponent
className={hasActiveAnimations && this.state.valueControlEnabled ? "" : "disabled"}
Expand Down