React에서 contenteditable을 이용해 글자수에 따라 width가 바뀌는 textfield 만들기 by 공채원
- span ` display: inline-block; font-weight: lighter; border-bottom: 1px solid #232323; font-size: 34px; max-width: calc(100% - 32px); min-width: 50px; // placeholder &:empty:before { content: attr(placeholder); color: grey; display: inline-block; }; ` interface Props { value : string ; onChange : Dispatch < React
- return ( < div onClick = { () => setEditable ( true ) } > < Input ref = { ref } placeholder = '이름 또는 애칭' spellCheck = { false } contentEditable = { editable } onInput = { handleInputEvent } /> div > ); }
- length >= MAX_LENGTH ) { setEditable ( false ); } onChange ( newValue ); }; return ( < div onClick = { () => setEditable ( true ) } > < Input ref = { ref } placeholder = '이름 또는 애칭' spellCheck = { false } contentEditable = { editable } onInput = { handleInputEvent } /> div > ); };
Python Grid 시각화 by 김경록 about Python
- pyplot as plt size = 10 grid = [[0] * size for _ in range(size)] for x in range(size): for y in range(size): if x == y: grid[y][x] = 1 plt
- y_size): grid = [[0] * x_size for _ in range(y_size)] return grid x_size = 5 y_size = 10 grid = get_grid(x_size
- y_size) for x in range(x_size): for y in range(y_size): if x == y: grid[y][x] = 1 plt