Skip to content

Commit

Permalink
Fix textarea again.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Apr 1, 2024
1 parent 451e93b commit e23c590
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ npm-debug.log*

yarn-debug.log*
yarn-error.log*
/build
16 changes: 16 additions & 0 deletions src/wireframes/renderer/TextAdorner.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.text-adorner-textarea {
border: 1px solid #d9d9d9;
font-size: 14px;
font-weight: normal;
outline: none;
padding: 4px;

&:active {
outline: none;
}

&:focus {
box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
border-color: #1677ff;
}
}
10 changes: 5 additions & 5 deletions src/wireframes/renderer/TextAdorner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { Keys, sizeInPx } from '@app/core';
import { DefaultAppearance } from '@app/wireframes/interface';
import { Diagram, DiagramItem, DiagramItemSet } from '@app/wireframes/model';
import { InteractionHandler, InteractionService, SvgEvent } from './interaction-service';
import { Input } from 'antd';
import { TextAreaRef } from 'antd/es/input/TextArea';
import './TextAdorner.scss';

const MIN_WIDTH = 150;
const MIN_HEIGHT = 30;
Expand Down Expand Up @@ -94,8 +93,8 @@ export class TextAdorner extends React.PureComponent<TextAdornerProps> implement
}
}

private doInitialize = (textarea: TextAreaRef) => {
this.textareaElement = textarea?.resizableTextArea?.textArea!;
private doInitialize = (textarea: HTMLTextAreaElement) => {
this.textareaElement = textarea;
};

private doHide = () => {
Expand Down Expand Up @@ -143,7 +142,8 @@ export class TextAdorner extends React.PureComponent<TextAdornerProps> implement

public render() {
return (
<Input.TextArea className='no-border-radius' style={this.style}
<textarea className='ant-input ant-input-outlined ant-input-css-var no-border-radius text-adorner-textarea'
style={this.style}
ref={this.doInitialize}
onBlur={this.doHide}
onKeyDown={this.doSubmit} />
Expand Down

0 comments on commit e23c590

Please sign in to comment.