Skip to content

Commit

Permalink
feat: some reasonable limits are in order + enter to save
Browse files Browse the repository at this point in the history
  • Loading branch information
RobiMez committed Apr 25, 2024
1 parent 8d101fb commit 9c5a9db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/routes/li/[room]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@
<input
bind:value={roomTitle}
type="text"
minlength="1"
maxlength="24"
on:keydown={(e) => {
if (e.key === 'Enter') {
if (roomTitle.length <= 0) return;
updateRoomTitle();
toggleEditTitle();
}
}}
class="min-h-8 rounded-sm border-none bg-base-300 p-1 font-extralight text-base-content focus:bg-base-100 focus:outline-none"
size={roomTitle.length > 5 ? roomTitle.length : 5}
style={`font-size: ${Math.ceil(roomTitle.length / 50)}em`}
Expand Down

0 comments on commit 9c5a9db

Please sign in to comment.