Dynamically resize text box for editing name

This commit is contained in:
Zimeng Xiong
2025-11-21 23:15:41 -08:00
parent 5925017868
commit 5979293e1b
+2 -1
View File
@@ -565,7 +565,8 @@ export const Editor: React.FC = () => {
value={newName} value={newName}
onChange={(e) => setNewName(e.target.value)} onChange={(e) => setNewName(e.target.value)}
onBlur={() => setIsRenaming(false)} onBlur={() => setIsRenaming(false)}
className="font-medium text-gray-900 dark:text-white bg-transparent px-2 py-1 border-2 border-indigo-500 rounded-md outline-none" className="font-medium text-gray-900 dark:text-white bg-transparent px-2 py-1 border-2 border-indigo-500 rounded-md outline-none min-w-[200px]"
style={{ width: `${Math.max(200, newName.length * 9 + 20)}px` }}
/> />
</form> </form>
) : ( ) : (