You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/06/22 13:37:39 UTC

[GitHub] [superset] villebro commented on a change in pull request #15235: chore: Improves the Select component UI/UX - iteration 2

villebro commented on a change in pull request #15235:
URL: https://github.com/apache/superset/pull/15235#discussion_r656223790



##########
File path: superset-frontend/src/components/Select/Select.stories.tsx
##########
@@ -0,0 +1,313 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React, { ReactNode, useState, useCallback } from 'react';
+import Select, { SelectProps, OptionsPromiseResult } from './Select';
+
+export default {
+  title: 'Select',
+  component: Select,
+};
+
+const DEFAULT_WIDTH = 200;
+
+const options = [
+  {
+    label: 'Such an incredibly awesome long long label',
+    value: 'Such an incredibly awesome long long label',
+  },
+  {
+    label: 'Another incredibly awesome long long label',
+    value: 'Another incredibly awesome long long label',
+  },
+  { label: 'Just a label', value: 'Just a label' },
+  { label: 'A', value: 'A' },
+  { label: 'B', value: 'B' },
+  { label: 'C', value: 'C' },
+  { label: 'D', value: 'D' },
+  { label: 'E', value: 'E' },
+  { label: 'F', value: 'F' },
+  { label: 'G', value: 'G' },
+  { label: 'H', value: 'H' },
+  { label: 'I', value: 'I' },
+];
+
+const selectPositions = [
+  {
+    id: 'topLeft',
+    style: { top: '0', left: '0' },
+  },
+  {
+    id: 'topRight',
+    style: { top: '0', right: '0' },
+  },
+  {
+    id: 'bottomLeft',
+    style: { bottom: '0', left: '0' },
+  },
+  {
+    id: 'bottomRight',
+    style: { bottom: '0', right: '0' },
+  },
+];
+
+export const AtEveryCorner = () => (
+  <>
+    {selectPositions.map(position => (
+      <div
+        key={position.id}
+        style={{
+          ...position.style,
+          width: DEFAULT_WIDTH,
+          position: 'absolute',
+        }}
+      >
+        <Select ariaLabel={`gallery-${position.id}`} options={options} />
+      </div>
+    ))}
+    <p style={{ position: 'absolute', top: '40%', left: '33%', width: 500 }}>
+      The objective of this panel is to show how the Select behaves when in
+      touch with the viewport extremities. In particular, how the drop-down is
+      displayed and if the tooltips of truncated items are correctly positioned.
+    </p>

Review comment:
       It would also be nice to have a story where the select can scroll




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org