fix mobile embed

This commit is contained in:
Jeff Emmett 2024-10-19 16:20:54 -04:00
parent 895d02a19c
commit 4e2103aab2
2 changed files with 10 additions and 5 deletions

View File

@ -5,7 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "concurrently --kill-others --names client,worker --prefix-colors blue,red yarn:dev:client yarn:dev:worker", "dev": "concurrently --kill-others --names client,worker --prefix-colors blue,red yarn:dev:client yarn:dev:worker",
"dev:client": "vite", "dev:client": "vite --host",
"dev:worker": "wrangler dev", "dev:worker": "wrangler dev",
"build": "tsc && vite build", "build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",

View File

@ -22,7 +22,12 @@ export class EmbedShape extends BaseBoxShapeUtil<IEmbedShape> {
} }
indicator(shape: IEmbedShape) { indicator(shape: IEmbedShape) {
return <rect x={0} y={0} width={shape.props.w} height={shape.props.h} />; return (
<g>
<rect x={0} y={0} width={shape.props.w} height={shape.props.h} />
<rect x={0} y={0} width={shape.props.w} height={shape.props.h} style={{ stroke: 'black', strokeWidth: 2, fill: 'none' }} />
</g>
);
} }
component(shape: IEmbedShape) { component(shape: IEmbedShape) {
@ -35,7 +40,7 @@ export class EmbedShape extends BaseBoxShapeUtil<IEmbedShape> {
if (!shape.props.url) { if (!shape.props.url) {
return ( return (
<div style={{ pointerEvents: 'all' }}> <div style={{ pointerEvents: 'all', border: '1px solid #000', borderRadius: '5px', padding: '5px' }}>
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
<input <input
type="text" type="text"
@ -44,7 +49,7 @@ export class EmbedShape extends BaseBoxShapeUtil<IEmbedShape> {
placeholder="Enter URL" placeholder="Enter URL"
style={{ width: shape.props.w, height: shape.props.h }} style={{ width: shape.props.w, height: shape.props.h }}
/> />
<button type="submit">Load</button> <button type="submit" onTouchStart={handleSubmit} onClick={handleSubmit}>Load</button>
</form> </form>
</div> </div>
); );