Skip to content

Commit ca93d07

Browse files
committed
fixed double scroll bar
1 parent 6405332 commit ca93d07

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

client/src/components/AdminView.tsx

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export const AdminView = () => {
162162
};
163163

164164
return (
165-
<div className="grid grid-flow-row space-y-4 pb-20">
165+
<div className="mb-20 grid gap-4">
166166
<h3>Create or Update Poll</h3>
167167

168168
{errorMessage && <p className="p3 py-4 text-center text-error">{errorMessage}</p>}
@@ -186,39 +186,38 @@ export const AdminView = () => {
186186
<div className="space-y-3 mb-4">
187187

188188
{options.map((opt, i) => (
189-
<div key={i} className="input-group" >
190-
<label className="label">Option {i + 1}</label>
191-
192-
<div className="flex items-center space-x-2" >
193-
<input
194-
type="text"
195-
className="input flex-grow"
196-
value={opt}
197-
onChange={(e) => {
198-
const copy = [...options];
199-
copy[i] = e.target.value;
200-
setOptions(copy);
201-
}}
202-
maxLength={pollOptionMaxTextLength}
203-
placeholder={`Option ${i + 1}`}
204-
/>
205-
206-
{options.length > minOptions && (
207-
<button
208-
type="button"
209-
className="p-2"
210-
onClick={() => removeOption(i)}
211-
style={{ flexShrink: 0 }}
212-
>
213-
<img src="https://sdk-style.s3.amazonaws.com/icons/delete.svg" alt="" />
214-
</button>
215-
)}
189+
<div className="flex">
190+
<div key={i} className="input-group grow" >
191+
<label className="label">Option {i + 1}</label>
192+
193+
<input
194+
type="text"
195+
className="input"
196+
value={opt}
197+
onChange={(e) => {
198+
const copy = [...options];
199+
copy[i] = e.target.value;
200+
setOptions(copy);
201+
}}
202+
maxLength={pollOptionMaxTextLength}
203+
placeholder={`Option ${i + 1}`}
204+
/>
205+
206+
<span className="input-char-count">
207+
{opt.length}/{pollOptionMaxTextLength}
208+
</span>
216209
</div>
217210

218-
{/* overlayed like your question field */}
219-
<span className="input-char-count -translate-x-10">
220-
{opt.length}/{pollOptionMaxTextLength}
221-
</span>
211+
{options.length > minOptions && (
212+
<button
213+
type="button"
214+
className="p-2 mt-5"
215+
onClick={() => removeOption(i)}
216+
style={{ flexShrink: 0 }}
217+
>
218+
<img src="https://sdk-style.s3.amazonaws.com/icons/delete.svg" alt="" />
219+
</button>
220+
)}
222221
</div>
223222
))}
224223
</div>

0 commit comments

Comments
 (0)